CSV ↔ JSON
Convert between spreadsheet data and JSON, with delimiter detection
Direction
Converts numeric strings to numbers and true/false to booleans. Values with leading zeros (like 007) stay as strings so no information is lost.
Enter something to convert
Last updated: 2026-10-11
About this tool
CSV looks simple but hides real traps: a field may itself contain a comma, a line break, or even a quote character — all of which must be wrapped in double quotes, with quotes doubled up inside. Splitting on commas will silently misalign every column. This tool parses per RFC 4180, handling quoted fields, escaped quotes and newlines inside quotes correctly, and it sniffs which delimiter is actually in use (Excel exports semicolon-separated CSV in some locales). When converting to JSON you can choose whether to infer numbers and booleans, and whether empty fields become null. Everything happens locally in your browser, so your file never gets uploaded.
Features
Quotes and newlines handled correctly
Fields may contain the delimiter or line breaks as long as they are quoted, and embedded quotes are doubled. This tool follows the standard instead of misaligning columns.
Automatic delimiter detection
Works out whether the file uses commas, tabs, semicolons or pipes — or you can set it explicitly. Excel uses semicolons in some regional settings.
Ragged rows aligned
If a row has fewer cells than the header, the gaps are filled rather than dropping the column — so no object ends up mysteriously missing a key.
Duplicate headers made unique
Repeated or blank column names get numeric suffixes, preventing same-named JSON keys from overwriting each other and silently losing data.
Optional type inference
Turns numeric strings into numbers and true/false into booleans. Values with leading zeros (like 007) stay strings so nothing is lost.
Works both directions
CSV to JSON and JSON to CSV. Nested objects are serialised to JSON text inside a single cell.
How to use
- 1
Pick a direction
Choose CSV → JSON or JSON → CSV.
- 2
Paste your data
Paste the CSV or JSON into the input box, or try the sample button.
- 3
Adjust options
Set the delimiter (auto-detect is fine), whether the first row is a header, type inference, and how empty values are handled.
- 4
Copy the result
The result pane shows the output — copy it, or check the table preview.
Options
- Direction
- CSV → JSON or JSON → CSV.
- Delimiter
- Comma, tab, semicolon, pipe, or auto-detect. Auto-detect picks whichever gives the most consistent column count.
- First row is a header
- When on, the first row becomes the JSON object keys; off gives a 2D array.
- Infer data types
- Converts numbers and booleans to their real types. Leading-zero strings are untouched.
- Empty fields become null
- On outputs null for blank cells; off outputs an empty string.
Common use cases
- Turn a CSV exported from a spreadsheet into JSON for an app
- Turn an API JSON array into a table a colleague can open
- Spot misaligned columns or unclosed quotes in an exported CSV
- Prepare the same test data in both CSV and JSON form
FAQ
Questions you may have about this tool
Why not just split on commas?
Because a CSV field may itself contain a comma. Per the standard, such fields are wrapped in double quotes, like `"Beijing, China",100`. Splitting on commas would cut that into three pieces instead of two and misalign the whole row. This tool handles quoted fields, doubled quotes and newlines inside quotes per RFC 4180.
Excel exported my file with semicolons?
That does happen — in some European locales the comma is the decimal separator, so the list separator is switched to a semicolon. The auto-detect option counts how consistently each candidate delimiter yields the same number of columns and picks the winner. You can also set it manually.
Can type inference corrupt my data?
We deliberately avoid the risky cases. Values with leading zeros (007, 0012) stay as strings, because converting them to numbers drops the zeros. Very long digit strings are also worth keeping as strings to stay within floating-point precision. If your data is type-sensitive, turning inference off is the safest choice.
Why are some rows shorter than the header?
CSV permits trailing empty fields to be omitted, which is perfectly legal. This tool pads the missing cells with empty values so every row has the same length — that way every JSON object comes out with a complete set of keys.
What happens with duplicate column names?
JSON object keys must be unique, otherwise later ones overwrite earlier ones and data disappears silently. This tool renames duplicates to `name_2`, `name_3` and skips names already taken, so every field survives.
How large a file can it handle?
The input limit is 5,000,000 characters and 100,000 parsed rows. Anything beyond that is truncated with a clear notice rather than silently dropped. Since this runs entirely in the browser, speed depends on your device — split very large files first.
Can nested JSON be turned into CSV?
Yes, but each nested object is serialised to JSON text inside a single cell — `{"deep":1}` becomes `"{""deep"":1}"`. That is inherent to CSV, which only has rows and columns, no nesting. Flatten nested structures with another tool first if you need them spread out.
Is my data uploaded anywhere?
No. Parsing and conversion happen in browser memory; nothing is sent or stored. Open your browser dev tools and check the network tab — you will see no related requests.