JSON Formatter
Pretty-print, validate and minify JSON with friendly error messages.
Convert CSV to JSON with automatic delimiter detection, header handling and real number types, 100% in your browser.
Your result is ready — download it below:
Re-encoded without size gain Download links expire within 30 minutes.
No result to display for the current input.
Convert CSV to JSON with automatic delimiter detection, header handling and real number types, 100% in your browser.
Paste CSV straight from a spreadsheet and get back a JSON array that an API, a script or a database import can actually read. The delimiter is detected for you, the header row becomes the field names, and cells that look like numbers or booleans are converted to real JSON types instead of staying quoted strings. Everything runs in your browser, so the data never leaves your machine.
A naive conversion makes every value a string, so "qty": "3" arrives where a number was expected and a spreadsheet import quietly stores the wrong type. This tool reads each cell and converts plain integers, decimals, true, false and null to their JSON equivalents.
Two safeguards stop that from going too far. A value with leading zeros such as 007 stays text, because a product code or a ZIP is not a number. And anything with more than 15 digits is left as a string rather than being rounded by a floating point number that cannot hold it exactly.
Files exported from spreadsheets in different locales use different separators: a comma in English, a semicolon in much of Europe, a tab or pipe in older systems. The tool tries all four and keeps whichever produces the widest rows on average.
That method only works if quoted fields are respected, and this parser follows RFC 4180 while doing it. A field such as "Leeds, UK" containing a comma is one field, not two, and a doubled "" inside a quoted field becomes a literal quote. Get that wrong and one stray comma makes every later row look ragged, which is the single most common reason a CSV import produces a mess.
With the header box ticked, the first row supplies the field names and each later row becomes one object. Problems that would otherwise produce broken JSON are repaired rather than ignored: a repeated name becomes name_2, a third becomes name_3, and a blank column heading becomes column_4.
Untick the header box and each row becomes an array of values in the order the columns appear, which is what you want for a file that genuinely has no field names. Values are still typed either way.
If a data row has fewer cells than the header, the missing ones become empty strings so the JSON stays rectangular and every record has the same keys. The result also tells you how many rows were affected, because a row count mismatch is almost always a delimiter appearing unquoted inside a value and is worth fixing at the source.
Blank cells become empty strings rather than null. In tabular exports a blank cell usually means the field was left empty, not that the value is unknown, and the difference matters when the JSON feeds a database import.
The usual destinations are API request bodies, seed data for a local database, fixtures for a test suite, and bulk imports through tools that expect JSON Lines or a single array. Because the output is generated in the browser, a file containing customer records or an internal export can be converted without being uploaded to a third party.
Use the indentation control to suit the destination: two spaces is easy to read, four matches the PHP, Python and Java defaults, and a tab suits an editor set up that way. Indentation is purely cosmetic and never changes the meaning of the document.
No. The conversion runs entirely in your browser using JavaScript, and your data is never sent anywhere. That matters most for exports containing customer or employee records.
Because leading zeros are significant. A product code, a ZIP or a phone number written as 007 would lose information as a number, so anything matching that shape is deliberately left as text.
Either the value has more than 15 digits, which cannot be represented exactly and is kept as text, or it uses exponent notation such as 1e10, which is left alone because the exact source formatting is unclear. Both choices avoid silently changing the number.
That row had fewer cells than the header, usually because a delimiter inside a value was not wrapped in double quotes. The missing cells become empty strings so the JSON stays valid, and the count of affected rows is reported so you can correct the source.
CSV to JSON Converter turns spreadsheet rows into a JSON array, guessing the delimiter and giving every cell a sensible type. Numbers, true, false and null become real JSON values instead of quoted strings, and the result runs entirely in your browser.
How to use: paste your CSV, leave the delimiter on auto-detect, and press Run. Tick the header box if the first row holds field names.
Pretty-print, validate and minify JSON with friendly error messages.
Turn any JSON into ready-to-compile Rust struct definitions with serde derives.
Turn any JSON into a TypeScript Zod schema with nullable and optional handling.
Convert any JSON into Go struct definitions with json tags and pointers for optionals.