Skip to content
DevTrove

JSON & Data

CSV ↔ JSON Converter

Convert CSV with a header row to a JSON array of objects, and JSON arrays of objects back to CSV.

Runs in your browser

Direction

Press Ctrl+Enter (⌘+Enter on Mac) to convert.

How to use

  1. Choose a direction: CSV → JSON or JSON → CSV.
  2. Paste your CSV (with a header row) or your JSON array of objects into the input box.
  3. Select Convert, or press Ctrl+Enter (⌘+Enter on Mac) in the input box.
  4. If the input is rejected, fix the reported line and column and convert again.
  5. Use Copy output to copy the result.

Supported CSV format

The converter follows the common RFC 4180 rules: fields are separated by commas, a field may be wrapped in double quotes, and a double quote inside a quoted field is written as two double quotes (""). Quoted fields may contain commas and line breaks. Rows may end with LF or CRLF, and a single line break at the very end is ignored. A UTF-8 byte order mark (BOM) at the start is removed so it never becomes part of the first column name.

Other delimiters such as semicolons, tabs or pipes are not detected or supported: a semicolon-separated file is read as a single column. Malformed CSV is never repaired. An unclosed quote, a quote inside an unquoted field, text after a closing quote or a bare carriage return is reported with its line and column, and no output is produced.

CSV → JSON: headers, rows and strings

The first row is the header. Each later row becomes one JSON object whose keys are the column names, in column order. Column names must be non-blank and unique (compared exactly, so "Name" and "name" are different). A blank or duplicate name is reported instead of being renamed, so no column can silently overwrite another.

Every row must have exactly as many fields as the header. A row with missing or extra fields — including a blank line between rows — is rejected rather than padded or cut, so no data is lost or invented. Every value stays a string exactly as written: 00123, true, null and 1.0 are not converted to numbers, booleans or null, and spaces are not trimmed. The output is JSON indented with 2 spaces.

JSON → CSV: columns and values

The input must be a JSON array whose items are all objects. The columns are the keys of the first object in their original order, followed by any new keys from later objects in the order they first appear; keys are never sorted. A key that an object does not have becomes an empty field. Objects with a repeated key are rejected, because standard JSON parsing would keep only the last value.

Strings are written as they are. Numbers are written exactly as in your JSON — 1.0 stays 1.0 and large integers such as 12345678901234567890 keep every digit. true and false are written as text, and null becomes an empty field. Nested arrays and objects become compact JSON text, for example ["a","b"], never [object Object]. A field is quoted only when it contains a comma, a double quote or a line break; rows end with LF and the first row is the header.

What a round trip keeps

CSV has no types, so converting JSON → CSV → JSON returns every value as a string: 30 becomes "30", true becomes "true", and null or a missing key becomes "". Arrays of objects that contain only strings and share the same keys come back unchanged.

Converting CSV → JSON → CSV keeps every row and value. The text can differ only in formatting: quotes are added only where needed, CRLF row endings become LF, and a final line break is dropped.

Spreadsheets and limits

CSV is plain text, and this tool writes your values exactly as they are. Spreadsheet applications may interpret some values when they open a CSV file — for example, text starting with =, +, - or @ can be treated as a formula — so check data from untrusted sources before opening it in a spreadsheet.

Input is limited to 5,000,000 characters and output to 20,000,000 characters. Output is never truncated: if it would be larger, nothing is produced.

FAQ

Is my data uploaded?
No. Your data is processed in your browser. Your CSV and JSON are not sent to a server, not stored, and not added to the page URL.
Why are numbers in my CSV converted to strings?
CSV does not record types, and guessing changes data: 00123 would lose its leading zeros and a long ID could lose digits. Every CSV value is kept as the exact text you provided.
Can I use semicolon- or tab-separated files?
Not yet. This version supports comma-separated values only, and does not guess the delimiter.