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.

Direction

The first row becomes the field names; each following row becomes one JSON object.

How to use

  1. Pick the direction at the top: CSV → JSON or JSON → CSV; the input label and hint update accordingly.
  2. Paste your content and choose the delimiter (usually "Auto-detect" recognizes commas, semicolons or tabs).
  3. 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.
  4. 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.
  5. 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?
No type inference is performed: every cell is output as a string so conversions round-trip losslessly. If your JSON side does have numeric fields, their text form is kept as-is when exporting to CSV.
How are quoted fields or fields containing delimiters handled?
The parser follows common CSV rules: fields may be wrapped in double quotes, inner quotes are escaped by doubling them, and delimiters or newlines may appear inside quotes. Exporting applies the same quoting automatically.
How are nested objects and arrays in JSON converted to CSV?
In flatten mode, nested objects become dot-path keys such as user.name; arrays cannot be expressed as columns, so they are written as JSON strings with a notice. In stringify mode, all objects and arrays are written as JSON text.
Is my data uploaded to a server?
No. Parsing and generation happen entirely in your browser: the content you paste never leaves your device.

How to use

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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

  1. 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.

  2. 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.

  3. 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.

Related Tools