CSV to JSON Converter

Convert CSV to JSON and back with delimiter auto-detect, header and type options. Big IDs and leading zeros stay intact. Free, no sign-up, no upload.

  • CSV ⇄ JSON both ways
  • Auto-detect delimiter
  • No lost big numbers
  • Excel-ready download

Your data is converted in your browser and never uploaded or saved.

🔒 Everything is calculated in your browser. No data is sent to any server.

When to use it

  • Excel data for developers: Convert a CSV saved from Excel into JSON to use directly in a web page or API.
  • API results into reports: Turn a JSON array from an API into CSV to analyze in Excel or Google Sheets.
  • Checking before an import: Confirm the fields and delimiter so leading zeros in codes like 007 or phone numbers aren’t lost.
  • Pasting from a spreadsheet: Cells copied from a spreadsheet are tab-separated, and they’re detected and converted automatically.

How to use

  1. Pick a direction (CSV → JSON or JSON → CSV), then paste your data into Input or use Open file to load a .csv, .tsv or .json file. The result appears in Output as you type.
  2. Adjust the options: the delimiter can be detected or set by hand, "First row is header" treats the first CSV row as field names, and "Convert types" turns numbers and true/false into JSON numbers and booleans.
  3. Use Copy or Download to get the result. Keep "Add BOM" on when the CSV will be opened in Excel. Swap moves the output back into the input so you can convert it the other way and check the round trip.

Worked example

CSV → JSON with header and type conversion on: the header id,name,price,active plus the rows 9007199254740993,Amy,1200.50,true and 007,Ben,300,false gives 2 rows × 4 columns. 300 becomes a number and true/false become booleans, while 9007199254740993 (beyond the safe integer range), 007 (leading zero) and 1200.50 (trailing zero) stay strings, so converting back to CSV reproduces them exactly.

JSON → CSV: [{"name":"Amy","tags":["a","b"]},{"name":"Ben","email":"ben@example.com"}] produces the columns name, tags and email (the union of both records), 2 rows × 3 columns. Amy has no email and Ben has no tags, so those cells are empty. The tags array becomes a JSON string, and because it contains commas and quotes it is written as "[""a"",""b""]".

Reading the results

  • The rows × columns count in the status line covers data rows only, not the header. Blank lines in the CSV are skipped and not counted.
  • A field-count warning means some rows have more or fewer fields than the header, usually because a value contains a comma but isn't quoted. Short rows are missing the trailing keys; extra values go into __parsed_extra.
  • Without "Convert types", every JSON value is a string. With it, only numbers and true/false are converted; empty cells stay empty strings and dates are left as text.
  • Duplicate header names are renamed automatically, so two columns called a become a and a_1 instead of one overwriting the other.

How it works

  • CSV parsing and output use the papaparse library and follow RFC 4180 quoting: fields containing the delimiter, a quote or a line break are wrapped in double quotes, and quotes inside are doubled. Output lines end with CRLF.
  • Delimiter detection tries comma, tab, pipe and semicolon and picks the one that gives the most consistent field count across rows. With a single column there is nothing to detect, so comma is used.
  • Type conversion rule: a value becomes a number only if turning it into a number and back yields the identical text, and integers must stay within the safe range of ±(2^53−1).
  • JSON → CSV: for an array of objects, the columns are the union of all keys in order of first appearance; a 2D array is written row by row; an array of plain values goes into a value column. Integers beyond the safe range are kept as their original text before parsing, so they are never rounded.
  • Opened files are decoded as UTF-8 first; if the bytes aren't valid UTF-8, Big5 is used instead.

Limitations

  • Only flat tables are supported. Nested JSON isn't flattened into columns like user.name; the whole object goes into one cell as a JSON string.
  • Delimiter detection relies on rows having the same number of fields. With very little data or ragged rows it can guess wrong, so choose the delimiter manually.
  • Only UTF-8 and Big5 files are decoded automatically. Save files in other encodings, such as Shift_JIS or GBK, as UTF-8 first.
  • All data is processed in browser memory, so files of tens of megabytes or more may make the page slow.

FAQ

Why weren't 007 and 1.50 converted to numbers?

With "Convert types" on, a value only becomes a number if converting it back gives exactly the same text. 007 would become 7 and 1.50 would become 1.5, breaking codes and prices, so they stay strings and the data round-trips back to CSV unchanged.

Excel shows garbled characters in the downloaded CSV. How do I fix it?

Turn on "Add BOM" before downloading. The BOM is an invisible marker at the start of the file that tells Excel to read it as UTF-8. When you open a CSV that isn't valid UTF-8, the tool falls back to Big5 decoding, which covers older Traditional Chinese Excel exports.

What happens to nested objects and arrays when converting JSON to CSV?

CSV is a flat table, so a nested object or array is written into a single cell as a JSON string, such as ["a","b"]. If records have different keys, the columns are the union of all keys and missing cells are left empty.

Is my data uploaded anywhere?

No. Parsing and conversion happen entirely in your browser. Nothing is sent to a server or stored, and the data is gone when you close the page.

How do I convert Excel to JSON?

In Excel, choose File → Save As → CSV UTF-8 and load it with “Open file”, or simply select the cells and copy-paste them. Then set the direction to “CSV → JSON”.

Does it work with Google Sheets?

Yes. Select a range, copy it and paste it in (tab separation is detected automatically), or download a CSV via File → Download → Comma-separated values and open it.

What does the JSON output look like?

With “First row is header” ticked, each row becomes an object whose keys are the column names, and the whole result is an array of objects; untick it and each row becomes an array.

References