JSON ⇄ CSV Converter
Convert JSON arrays to CSV and CSV back to JSON.
This tool runs entirely in your browser. Your data is never uploaded, never stored, and never leaves your device.
Converts a JSON array of objects into spreadsheet-ready CSV, and parses CSV back into a JSON array, handling quoted fields that contain commas, quotes or line breaks in both directions.
How to use it
- 1Pick a direction with the JSON → CSV and CSV → JSON buttons.
- 2Paste into the Input box. Conversion is live, and the Output label counts the rows produced; a bare object or an array of anything other than objects is rejected with "Input must be a JSON array of objects".
- 3Copy the output — bearing in mind that CSV → JSON returns every value as a string, because CSV carries no types to preserve.
Example
- Input
- [{"name":"Alice","age":30},{"name":"Bob"}]
- Output
- name,age Alice,30 Bob,
The header is the union of every key seen, in first-appearance order, so Bob's missing age becomes an empty cell rather than a shifted column. Nested objects are not flattened — they arrive as the literal text [object Object], so flatten before converting.
What happens to your data
This tool runs entirely in your browser. Your input is never uploaded to a server, never stored, and never logged. The exports people paste here are usually order lines or customer records, and none of it is transmitted.
Last updated August 2026
Someone sends a JSON export and the person who actually needs it works in a spreadsheet. Or the reverse: finance sends a CSV of last quarter's orders and the API you are feeding wants an array of objects. Both are the same short job, and both go wrong in the same place — the shape of the data rather than the syntax.
Decide before you paste which of two things you are holding. A flat array of objects, one entry per record and every value a string, number or boolean, maps onto rows and columns with nothing lost. Anything with structure inside it — an address object, a list of tags, an array of line items — does not, because a cell holds one value and has no way to contain another. Flatten those into columns like address_city first, or pull the nested array into a second table with a key that joins the two back together. Nothing raises an error if you skip that step, which is why the problem usually gets noticed by whoever opens the spreadsheet rather than by you.
The trip is also not symmetrical, so do not treat it as a round trip. Send an array out to CSV and read it back and what returns is not what you started with: a number arrives as the characters that spelled it, true as the word true, and a null as an empty cell that no longer differs from a genuinely blank field. Keep whichever side is your source of truth rather than regenerating it from the other.
The mistake that follows both is downstream — opening the finished CSV in Excel, which rewrites leading zeros, long identifiers and anything resembling a date as it reads.
How it works
Toolvore runs both directions inside the page with two small functions and no library. Going out, the text goes to the browser's own JSON parser, each value is turned into a string, and a cell is wrapped in quotation marks only when it contains a comma, a quotation mark or a line break — with any quotation mark inside it doubled, which is the escape CSV actually specifies. Rows are joined with a carriage return and line feed, the pairing Excel expects. Coming back, a hand-written reader walks the text one character at a time and tracks whether it is currently inside quotation marks, so a comma or a line break within a quoted field splits nothing. The weak points sit at the edges. A comma is the only delimiter it knows, so a semicolon-separated export — the Excel default across much of Europe — arrives as a single column. Nothing strips a byte-order mark, so one saved by Excel becomes part of the first column's name. Two columns sharing a header name collapse to the last, and any cells beyond the last header are dropped.
Common use cases
- Handing a JSON API export to a colleague who works in a spreadsheet
- Turning a CSV of orders into an array of objects for a seed script or test fixture
- Getting a row count out of an export someone has pasted into a ticket
- Preparing a contact or product list for a bulk upload form that only accepts CSV
- Reading a CSV whose quoted fields contain commas, without a spreadsheet reformatting it
- Converting a small lookup table into JSON to paste into code
Frequently asked questions
How do I convert JSON to CSV when the objects have nested data?+
Flatten first, and there are two shapes to choose between. If the nested part is a single object — an address, a block of metadata — give each leaf its own column with a joined name, address_city and address_postcode, so one row still means one record. If it is an array of children, such as line items on an order, one table cannot hold it honestly: either write a second CSV with one row per child and an order id pointing back, or accept a lossy summary like joining tags into a single cell with a semicolon. Choose before you convert, because the right answer depends on what the spreadsheet is for.
Why does my CSV open in Excel as one long column?+
Because Excel splits on whatever your locale calls the list separator, and across much of Europe that is a semicolon. A comma-separated file opened by double-clicking on such a machine lands entirely in column A. The fix is not to double-click: use Data, then From Text/CSV, and set the delimiter and the encoding yourself in the import dialogue. Google Sheets asks the same question under File, Import. The other direction matters here too — a semicolon-separated export pasted in for conversion comes back as one field per row, because a comma is the only separator this reader recognises.
Why does Excel change my ID numbers and dates when it opens a CSV?+
Because a CSV carries no types, so the spreadsheet guesses, and its guesses are aggressive. Leading zeros vanish from postcodes and product codes. An identifier past fifteen digits is shown in scientific notation and the trailing digits are genuinely lost rather than merely hidden. Anything resembling a date is rewritten as one. None of that is in the file — it happens as Excel reads it, which is why the same file looks correct in a text editor. Import through Data, From Text/CSV and mark those columns as Text, or keep the JSON as your source of truth and treat the CSV as a view of it.
How do you put a comma or a line break inside a CSV field?+
Wrap the whole field in quotation marks. Inside them a comma is just a comma and a line break belongs to the value rather than starting a new row. A quotation mark inside the field is written twice rather than escaped with a backslash, which is the rule most people get wrong, since backslash escaping is not part of the format at all. Those conventions come from RFC 4180, the nearest thing CSV has to a specification, and they are what this converter implements in both directions. Quotes are added only where a field needs them, so ordinary values stay unquoted and the output stays readable.
Where does my data go when I paste it into an online converter?+
Here, nowhere. Both conversions are plain JavaScript functions running in the page you already have open, recomputed as the text in the box changes. There is no upload, no download and no request to a server, and the text lives only in the page's own state, so closing or refreshing the tab clears it. That matters for this job in particular, since what people paste into a JSON to CSV box is usually a customer export or an order list. With converters generally, the questions worth asking are whether the file is sent somewhere to be processed and how long it is kept.
Everything comes back from a CSV as a string — how do I get the types back?+
You add them back deliberately, because the file genuinely does not contain them. Cast the fields you know: Number on the numeric ones, an explicit comparison against the word true for booleans, a date parser where a column really does hold dates. Resist a blanket auto-detect that converts anything number-shaped — that is what quietly destroys phone numbers with leading zeros, version strings like 1.10, and identifiers long enough to lose precision. Blank cells are the other ambiguity: an empty field could mean an empty string, a null, or a key that was never there, and only you know which.
My JSON has one object per line instead of an array — will that work?+
Not as it stands. One object per line is JSON Lines, also called NDJSON: a stack of separate documents rather than a single one, which is exactly what makes it good for streaming and for appending to a log. A parser expecting one array rejects it with a syntax error. Converting is mechanical — put a comma at the end of every line but the last and wrap the lot in square brackets, which jq -s does in one step. Going the other way, take your array, drop the outer brackets and put each object on its own line with no trailing commas.
What encoding should a CSV use, and what is the byte-order mark about?+
UTF-8, in nearly every case: it covers accented names and non-Latin scripts, and JSON is assumed to be UTF-8 already. The complication is Excel on Windows, which historically read a plain UTF-8 file using the local code page and turned accented characters into mojibake unless the file opened with a byte-order mark — three invisible bytes announcing the encoding. That mark then causes trouble of its own, because many parsers, this one included, treat it as an ordinary character: it becomes part of the first column's name, and a lookup for id fails against a key that is not quite id. Strip it, or import the file rather than double-clicking it.
Used in these workflows
Related tools
JSON Formatter & Validator
Format, validate, and minify JSON documents.
YAML ⇄ JSON Converter
Convert YAML documents to JSON and back.
CSV to Markdown Table
Turn CSV data into a formatted Markdown table.
Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal.