Spreadsheets export CSV, and web apps and APIs want JSON. The gap between the two is small but easy to trip over: CSV is plain text with no data types, while JSON has strings, numbers, booleans and null. The Kwebby CSV to JSON converter turns a pasted or uploaded CSV into JSON, and turns a JSON array back into CSV, in your browser.
This page shows how to use it, what it does with your data, and which limits to check before the output goes into an app.
Key Takeaways
- Kwebby's CSV ↔ JSON Converter converts in both directions: CSV → JSON and JSON → CSV.
- You choose the delimiter: Comma, Semicolon, Tab or Pipe. It applies in both directions.
- The parser follows RFC 4180 quoting: a value in double quotes can hold the delimiter, a line break or an escaped quote ("").
- With "First row is header" ticked, column names become the keys in each JSON object. Untick it to get an array of arrays.
- Every value comes out as a string, so numbers appear in quotes. Convert types in your own code.
- You can upload a .csv, .tsv, .txt or .json file up to 20 MB and download the result. The file is read in your browser, not uploaded.
- JSON → CSV collects columns from every object and quotes a field only when it needs quotes.
What Is the Kwebby CSV to JSON Converter?
Kwebby's CSV to JSON converter is a free online tool that turns CSV data into structured JSON and converts JSON arrays back into CSV. You paste your data into the Input pane or upload a file, choose a delimiter and copy or download the result from the Output pane. The conversion runs in your browser as you type, and the page's script sends your data nowhere.
It suits spreadsheet exports, test data and files that need to become JSON for a web app or an API.
Key Features and How It Works
Two directions
The tool has two modes: CSV → JSON and JSON → CSV. Use the first to turn rows into objects, and the second to flatten a JSON array into rows for a spreadsheet.
Four delimiters
The Delimiter options are Comma, Semicolon, Tab and Pipe. Comma is standard, but many European exports use a semicolon because the comma is the decimal mark. Tab-separated files (TSV) and pipe-separated files are common in database and log exports. The choice applies in both directions: CSV → JSON reads with it and JSON → CSV writes with it. Uploading a .tsv file selects Tab for you.
Column names become keys
With "First row is header" ticked (the default), the first row becomes the keys. A file that starts with name,age and has a row Alice,30 turns into an object with the keys name and age. If a row has fewer cells than the header, the missing keys get an empty string. Extra cells beyond the header are kept under keys such as column4, and a blank header cell becomes column1, column2 and so on. Untick the box to get an array of arrays, one inner array per row.
Quote-aware parsing
RFC 4180 says a field containing the delimiter, a double quote or a line break should be enclosed in double quotes, and a quote inside such a field is written twice. The parser follows those rules, so "Austin, TX" stays one value, "He said ""hi""" becomes He said "hi", and a quoted value can span several lines. It also accepts Windows (CRLF) and Unix (LF) line endings, skips a leading byte order mark and ignores blank lines. The "Trim spaces" option, on by default, removes spaces around each value; untick it to keep them.
File upload and download
Click Upload file to load a .csv, .tsv, .txt or .json file up to 20 MB. The browser reads it locally and the text appears in the Input pane; a .json file switches the tool to JSON → CSV. Download saves the result as data.json, data.csv or data.tsv.
Readable output with Copy and Clear
The JSON output is pretty-printed with two-space indentation so you can read it. The Copy button puts the result on your clipboard, and Clear empties the Input pane for the next job.
Why CSV to JSON Conversion Matters
CSV is the common export format for spreadsheets and databases, and JSON is the common format for web APIs. Converting between them lets spreadsheet data feed an app without retyping it.
Two details make it more than a format swap. First, CSV is not a formal standard. RFC 4180 is an informational document that "does not specify an Internet standard of any kind", so delimiters, quoting and encodings vary between tools. Second, JSON is typed. RFC 8259 defines objects, arrays, strings, numbers, booleans and null, but CSV stores everything as text. A converter has to decide what each cell becomes, and you should check the result.
How to Use the CSV to JSON Converter
- Choose a direction. Click CSV → JSON to turn rows into objects, or JSON → CSV to go the other way.
- Pick the delimiter. Select Comma, Semicolon, Tab or Pipe to match your file.
- Paste or upload your data. Paste into Input or click Upload file. For CSV with column names in the first row, leave "First row is header" ticked.
- Read the Output. The converted data appears in the Output pane straight away, formatted for reading.
- Click Copy or Download. Paste the result into your code, API client or spreadsheet, or save it as a file.
- Click Clear when you finish. Start the next conversion with an empty Input pane.
Here is the idea with a small sample. This CSV:
name,age,city
Alice,30,NYC
Bob,25,LA
becomes an array of objects like this:
[
{
"name": "Alice",
"age": "30",
"city": "NYC"
},
{
"name": "Bob",
"age": "25",
"city": "LA"
}
]
Notice that age is the text "30", not the number 30.
Best Practices for CSV to JSON Conversion
Clean the header row first
Use unique, short column names without blanks. Duplicate or empty headers produce overwritten or missing keys, which breaks code that reads the JSON.
Match the delimiter to the file
If the output shows one long value per row, the delimiter is wrong. Switch between Comma, Semicolon, Tab and Pipe until each column splits cleanly.
Quote values that contain the delimiter
Common mistake: a hand-written CSV with a value such as Austin, TX and no quotes around it. The parser reads that as two cells. Wrap such values in double quotes, as in Ben,"Austin, TX", which spreadsheet exports do for you. Quoted values may also contain line breaks.
Check data types
Every value is a string, so convert numbers and booleans in your code if your API expects them. Keep IDs and ZIP codes with leading zeros, such as 02134, as text, which is what the output already does.
Expect flat data in JSON → CSV
The tool collects the keys of every object as columns, in the order it first sees them, and leaves a cell empty when an object lacks a key. Nested objects and arrays are written as JSON text inside one cell, so flatten nested data first if you want separate columns. An array of arrays becomes plain rows with no header. If the input is not valid JSON, the Output pane shows "Invalid JSON".
Compare before and after
For a large or important conversion, convert twice with different settings and compare the outputs in the Diff Checker. It shows exactly what changed.
Use a dedicated parser for messy or very large files
A browser tool suits everyday exports up to the 20 MB upload limit. For files with millions of rows, use a CSV library or a command-line tool such as csvkit.
Common Use Cases
- Spreadsheet to web app. Export a Google Sheet or Excel file as CSV and convert it to a JSON file your app can load.
- Database export to API import. Turn a CSV dump into JSON for a REST API.
- Chart data. Prepare analytics exports for a charting library.
- Mailing lists and contact files. Convert a CSV for scripts, but only process personal data you have the right to use.
- Test data. Build sample rows, for example from the Fake Address Generator, and convert them to JSON fixtures.
- JSON to spreadsheet. Flatten an API response into rows you can open in a spreadsheet.
Related Kwebby Tools
More data tools live in the Developer Tools hub:
- XML to JSON converts XML data to JSON, for feeds and older systems.
- Diff Checker compares two texts, such as two JSON outputs, and shows the differences.
- Comma Separating Tool turns lists into comma-separated values you can paste straight into the converter.
- Fake Address Generator creates fictional profiles for test rows.
Frequently Asked Questions (FAQs)
How do I convert CSV to JSON?
Paste your CSV into the Input pane of Kwebby's converter or upload the file, choose the matching delimiter and read the JSON in the Output pane. Put column names in the first row so each object gets keys. Click Copy or Download to use the result.
Can I convert JSON back to CSV?
Yes. Switch to JSON → CSV, paste a JSON array into Input and copy the CSV from Output. Each object maps to one row, and the columns come from every key found. Values that contain the delimiter, a quote or a line break are quoted for you.
Does it handle commas inside quoted values?
Yes. The parser follows RFC 4180, so a value in double quotes such as "Austin, TX" stays one value. Quoted values can also hold line breaks and escaped quotes written as two double quotes.
Why are my numbers showing up as text in the JSON?
The converter does not guess types, so it writes every value as a string. CSV stores everything as text anyway. Convert types in your code if your API needs numbers, and keep IDs with leading zeros as text.
How do I convert CSV to JSON in Python or JavaScript?
In Python, read the file with the standard csv module's DictReader and write the rows with json.dump. In JavaScript, parse the CSV with a library such as csvtojson from npm, then call JSON.stringify. For one-off jobs with clean data, the online converter is faster.
Is the Kwebby CSV to JSON converter free?
Yes. The tool is free and needs no account. The conversion runs in your browser.
Final Thoughts
Converting CSV to JSON is simple when you check three things: the delimiter, the header row and the data types. Kwebby's converter handles quoting and delimiters, and your checks keep the result usable.
Paste a sample of your file now and compare the result with what your app expects. If your data starts as XML, try the XML to JSON converter, or browse the full Kwebby tools list.