JSON to CSV Converter
About the JSON to CSV Converter
The JSON to CSV Converter turns a JSON array of objects into CSV and parses CSV back into JSON, entirely in your browser. CSV is read and written following RFC 4180: quoted fields, doubled quotes, embedded line breaks, and CRLF row ends all work. Nested JSON objects are flattened into dot-path column names such as `user.address.city`, and in the other direction those headers can be turned back into nested objects. Use it to move API responses into a spreadsheet, load a spreadsheet export into a script or a database seed file, or check what a CSV really contains. Conversion runs in your browser and nothing is sent to our servers or analytics. The input is not saved in the page address; it goes into a link only when you click Share, so avoid sharing data that contains personal information or secrets.
Updated: November 13, 2026
Related Tools
How to use the converter
- Paste or drop your JSON or CSV into the input area. When the input box was empty, the direction is picked from the first non-space character of what you add: `{` or `[` means JSON, anything else means CSV. Use the JSON to CSV and CSV to JSON buttons to set it yourself.
- The output updates as you type. Swap moves the output into the input and flips the direction.
- For JSON to CSV, pick the delimiter: comma, semicolon, tab, or pipe. Turn on "Prefix formulas with '" if the CSV will be opened in a spreadsheet (see below).
- For CSV to JSON, the delimiter can be Auto, which counts commas, tabs, semicolons, and pipes in the first row (outside quotes) and picks the most frequent. The options below the direction buttons control whether the first row is a header, whether values are converted to numbers, booleans, and null, whether dot-path headers become nested objects, and the JSON indent (2 spaces, 4 spaces, or minified).
- Copy the result, or click Save to download it as `converted.csv` or `converted.json`. You can also drop a `.json`, `.csv`, `.tsv`, or `.txt` file onto the input.
How JSON becomes CSV
- An array becomes one row per item. A single object becomes one row. Items that are not objects (numbers, strings, nested arrays) go into a column named `value`.
- The header row is the union of all keys, in the order they are first seen, so rows with different keys still line up and missing values are left empty.
- Nested objects are flattened: `{"a":{"b":1}}` produces a column `a.b`. Arrays and empty objects are not expanded; each is written as JSON text in a single cell, such as `["x","y"]`. `null` becomes an empty cell. A key that itself contains a dot cannot be told apart from a nested path when converting back.
- A cell is wrapped in double quotes when it contains a quote, the delimiter, or a line break, and quotes inside it are doubled. Rows end with a line feed (LF), not CRLF.
- Spreadsheet formulas. Excel, LibreOffice, and Google Sheets run a cell that starts with `=`, `+`, `-`, or `@` as a formula, so data from an untrusted source can trigger one when the CSV is opened (CSV injection). Values are written unchanged by default. With "Prefix formulas with '" on, a cell whose first non-space character is one of those (or its full-width form), or that starts with a tab or a carriage return, gets a leading `'`, which spreadsheets show as text. Plain numbers such as `-5` are left as they are. It is off by default because the prefix stays in the text when the CSV is read by anything other than a spreadsheet.
How CSV becomes JSON
- With "First row is header" on, each following row becomes an object keyed by the header names. Blank header names become `column_N`, and repeated names get a `_2`, `_3` suffix so no value is overwritten. With it off, every row becomes an array of cells.
- With "Infer types" on, a cell that is exactly `true`, `false`, or `null` becomes that JSON value, and a cell that looks like a plain number becomes a number. Numbers with a leading zero (`007`), integers too large to be exact in JavaScript, and everything else stay text. Empty cells are always empty strings. With the option off, every value stays a string.
- With "Nest dot paths" on, a header `user.name` becomes `{"user":{"name":...}}`. Segments are always object keys, never array indexes. If one header is a path prefix of another (for example `a` and `a.b`), the longer one stays flat so no data is lost.
- Every row must have as many fields as the header. A row that does not is reported with its line number instead of being padded or truncated.
Errors, limits, and privacy
- Invalid JSON shows the parser message. CSV problems name the line: an unterminated quote reports the line where the quoted field started, and text right after a closing quote is reported too. A leading UTF-8 byte order mark, as written by Excel, is removed.
- Results are limited to 1,000,000 cells (rows times columns). A larger result shows a "too large" message instead of freezing the page. This matters for JSON arrays whose objects all have different keys, because the CSV needs one column for every distinct key.
- Conversion runs in your browser tab and no request carries your data. Your direction and option choices are saved in the page address as you change them; the pasted text is not, so it is not sent to our CDN on reload and does not stay in browser history. The text goes into a link only when you click Share. Long input is compressed with lz-string, which is not encryption, so anyone with the link can read it.
Frequently Asked Questions
- How are nested objects handled when converting JSON to CSV?
- Nested objects are flattened into dot-path columns, so `{"user":{"name":"Ada"}}` gives a `user.name` column. Arrays are not expanded into extra columns; an array inside a row is written as JSON text in one cell. Converting back with "Nest dot paths" on rebuilds the objects, but the array cell stays a string of JSON text.
- What happens when the objects in my array have different keys?
- The header is the union of every key, in the order each was first seen. A row that lacks a key gets an empty cell in that column. Very uneven data can create a large table, and a result over 1,000,000 cells is refused.
- Does it follow RFC 4180?
- The parser accepts quoted fields, doubled quotes inside them, line breaks inside quoted fields, and CRLF, LF, or CR row ends. The writer quotes any cell holding a quote, the delimiter, or a line break. Two differences from the letter of the RFC: the writer ends rows with LF rather than CRLF, and blank lines in the input are skipped. The delimiter is not limited to commas.
- Why did my numbers or IDs change type?
- With "Infer types" on, cells that look like plain numbers become JSON numbers, and `true`, `false`, and `null` become JSON values. A value such as `007` or a long ID beyond JavaScript's exact integer range stays text. Turn the option off to keep every value a string, which is safest for IDs, ZIP codes, and phone numbers.
- Can I convert semicolon- or tab-separated files?
- Yes. Choose Semicolon, Tab, or Pipe as the delimiter, or leave CSV to JSON on Auto to have it detected from the first row. Spreadsheet exports in regions that use a decimal comma are often semicolon-separated, and `.tsv` files are tab-separated.
- Why does Swap give a single "value" column after converting CSV with the header off?
- With "First row is header" off, each CSV row becomes a JSON array of cells, not an object. Swap then converts that JSON back to CSV, and items that are not objects go into one column named `value`, each row written as JSON text such as `["Ada","36"]`. To get the original columns back, turn "First row is header" on before swapping, or add a header row to the CSV so each row becomes an object.
- Is my data uploaded anywhere?
- No. Parsing and conversion run in your browser, and nothing is sent to our servers or analytics. The input is not written to the page address; it is placed in a link only when you click Share, which asks you to confirm because the content may be sensitive.