CSV to JSON Converter
Convert between CSV and JSON in both directions: map the first CSV row to keys of a JSON array of objects, or turn an array of objects back into CSV. Delimiter auto-detection, nested-object flattening and JSON stringify are supported: all done locally in your browser.
How to use
- Pick the direction at the top: CSV → JSON or JSON → CSV; the input label and hint update accordingly.
- Paste your content and choose the delimiter (usually "Auto-detect" recognizes commas, semicolons or tabs).
- For CSV → JSON, the first row is treated as field names and every other row becomes one object; for JSON → CSV, the input should be an array of objects and the header is derived from all keys.
- With nested objects choose "Flatten as dot path" or "Stringify as JSON"; arrays and other non-flattenable values are written as JSON strings with a notice.
- Click "Convert" to see the result, then use "Copy" or "Download file"; "Example" loads demo data instantly.
FAQ
Are CSV numbers converted to JSON numbers?
How are quoted fields or fields containing delimiters handled?
How are nested objects and arrays in JSON converted to CSV?
Is my data uploaded to a server?
How to use
- Choose the direction
Pick CSV → JSON or JSON → CSV from the direction chips. The input label and hint update automatically, so data always lands in the right place.
- Set the delimiter
Keep Auto-detect to recognize commas, semicolons or tabs. For files where detection is ambiguous, force a specific delimiter so columns are not split incorrectly.
- Handle nested objects
For JSON to CSV, choose Flatten to turn nested objects into dot-path keys like user.name. Or choose Stringify to store nested objects as JSON text; arrays are written as JSON strings with a notice.
- Convert and review
Click Convert: for CSV to JSON, the first row becomes the field names and each row turns into one object. The reverse direction derives the header from all keys found.
- Copy or download
Take the result away with Copy, or click Download file to save it as a CSV or JSON file. The Example button loads demo data whenever you want to rehearse.
About this tool
This is a two-way converter between CSV and JSON. Going to JSON, the first CSV row supplies the field names and every following row becomes one object. Going back, an array of objects is flattened into a table. Delimiters are auto-detected among comma, semicolon and tab. Nested objects can become dot-path keys or JSON strings, and every cell round-trips as text so no value is silently coerced. All parsing and generation run locally in your browser.
Typical jobs: turning an Excel export into JSON fixtures for frontend tests, or presenting an API response as a spreadsheet colleagues can open. It also moves data between scripts and low-code platforms, or gives a quick look at a table before restructuring it. Numbers stay strings and quoting follows standard CSV rules: embedded delimiters, doubled quotes and newlines inside fields all survive. The tool therefore behaves predictably on messy real-world exports from finance tools, CRMs and survey platforms.
How it works
CSV has never had a true official standard. It circulated from the mainframe era of the 1970s, and RFC 4180 only codified the conventions in 2005. The leftover disagreements are visible everywhere: European Excel exports use semicolons because the comma is the decimal mark, which is why delimiter auto-detection matters. RFC 4180 requires fields containing commas, double quotes or line breaks to be wrapped in quotes with inner quotes doubled. Software still disagrees about multi-line fields. Assume the dialect is impure and pilot a small sample before converting the whole file.
Keeping every cell a string dodges two classic accidents. The first is type misreading. Excel silently turns inputs like 1-2 or 3/4 into dates. In 2016 the human gene nomenclature committee renamed symbols such as SEPT1 because Excel kept converting them. The second is precision. IEEE 754 doubles carry roughly 15 to 17 significant digits. An 18-digit ID number quietly loses digits once it becomes a number. Strings survive the round trip intact. Cast downstream, explicitly, when math is actually needed.
When to use it
- Building frontend test data
Export the product team's Excel sheet as CSV, convert once, and the JSON array doubles as mock data. Field names and values stay visible and checkable, and later edits mean editing a spreadsheet instead of rewriting objects.
- Handing API data to non-developers
Convert an array of API objects to CSV, and colleagues can filter and sort it in any spreadsheet app. Nested fields flattened into dot-path column names make each value's origin obvious, which cuts explanation time.
- Moving data between platforms
When data travels between low-code platforms, BI tools and scripts, CSV is the most portable middleman. Convert a small batch first and check headers, encoding and delimiters. Scale up only after that, and the import will not arrive misaligned.
Tips & tricks
- No type inference happens: numbers like age or amount stay strings in the JSON output. Cast them downstream if your code expects numeric types.
- Fields containing commas, quotes or line breaks are wrapped in double quotes, with inner quotes doubled. This applies both when parsing and when exporting back to CSV.
- For JSON to CSV the input must be an array of objects. Keys missing on some records still get columns, and those cells are simply left empty.
Things to watch
- Opening in Excel mutates data
Double-click a CSV into Excel and save it, and the data gets damaged. Long numbers turn into scientific notation, leading zeros vanish and dates get reformatted. Use the import wizard and set every column to text, even just for viewing.
- UTF-8 without BOM turns to mojibake
Excel opening a BOM-less UTF-8 file guesses the encoding from the system locale, and Chinese text becomes garbage. Files meant to be double-clicked should carry a BOM. Machine-to-machine transfers are better off without one, so choose by purpose.
- A newline inside quotes is data
A line break inside a quoted field belongs to the data; only breaks outside quotes start a new record. Pressing Enter inside quotes while hand-editing splits one record into two broken ones. Misaligned conversion output usually traces back here.