JSON Formatter
Pretty-print and validate JSON, with the exact line and column of any error.
Convert CSV into JSON, and JSON back into CSV.
CSV to JSON Converter moves tabular data between the two formats people actually exchange it in. Paste a block of CSV copied from a spreadsheet and get an array of JSON objects, one per row, keyed by the header line. Switch direction and an array of JSON objects becomes CSV ready to open in a spreadsheet.
Real CSV is messier than it looks, and the parser handles the awkward parts rather than splitting naively on commas. Fields wrapped in quotes can contain commas, line breaks and escaped quotes, and all of that survives the trip. You can set the delimiter to a semicolon or a tab for data exported from European spreadsheets or from a database, and choose whether the first row is a header.
Numbers and the words true and false can optionally be converted to real JSON types rather than left as strings, which is usually what you want when the output is going into code. Converting back to CSV writes a header row from the keys found across all records and quotes any value that needs it.
The csv to json converter is used by writers, developers, students, marketers and anyone else who needs the job done once without installing software. Common cases include:
A field wrapped in double quotes can contain commas, line breaks and quotes, exactly as the CSV convention allows. A doubled quote inside a quoted field is read as a single literal quote. Splitting naively on commas is the usual cause of corrupted imports and this parser does not do it.
Missing values become empty strings and extra values are given generated keys, so no data is silently dropped. The row count and column count reported after conversion will show you when something is uneven.
Usually yes when the JSON is going into code, so that 42 arrives as a number rather than a string. Leave it off when values such as postcodes, phone numbers or product codes have leading zeros that must be preserved.
Yes. Set the delimiter to semicolon. Spreadsheets in locales that use a comma as the decimal separator export semicolon-delimited files, which is why a plain CSV parser mangles them.
Nested values are written as JSON text inside the cell, because CSV has no concept of nesting. Flatten the structure first if you need nested fields as separate columns.
No. Parsing and conversion happen in your browser, so customer lists and exports containing personal data stay on your device.
If the csv to json converter is not quite what you need, these other free tools solve closely related problems.
Pretty-print and validate JSON, with the exact line and column of any error.
Strip whitespace from JSON and compare original and minified sizes.
Add text to the start or end of every line, with optional numbering.
Order any list A-Z, Z-A, by number, by line length, or simply reverse it.
Deduplicate any list of lines, with case-sensitive and empty-line options.