CSV and JSON Converter: Convert Both Ways
Convert between CSV and JSON in one workspace. Choose the direction, delimiter, and available parsing options for the data you need.
CSV ↔ JSON Converter workspace
Two-Way Conversion
Switch direction with one click. CSV becomes a clean JSON array of objects; JSON arrays become RFC 4180-compliant CSV with proper escaping.
RFC 4180 Correctness
Quoted fields, escaped quotes ("" → "), embedded newlines, custom delimiters (comma, tab, semicolon, pipe). The hard edge cases other converters silently mangle — handled.
Smart Type Inference
Opt in to convert "123" → 123, "true" → true, and empty → null. Or keep everything as strings to preserve the source verbatim — your choice.
100% Client-Side
Parsing happens in your browser. CSV/JSON payloads — even gigabytes of analytics export — never touch our servers. Safe for HR data, financials, and PII.
CSV to JSON Converter: turn spreadsheet rows into a JSON array (and back)
Convert between CSV and JSON in one workspace. Choose the direction, delimiter, and available parsing options for the data you need. Use this bidirectional workspace when you need to move between formats. The dedicated CSV to JSON and JSON to CSV pages focus on one direction. Check identifiers, empty fields, nested values, and inferred types before importing the result into another system.
How to use the CSV ↔ JSON converter
- Pick the direction: CSV → JSON or JSON → CSV with the switch toggle.
- Paste your data, or load the built-in sample to see the expected shape.
- Choose the delimiter — comma, tab, semicolon, or pipe — to match your file.
- Leave Has header row on to key objects by column name; turn it off to get generic
col_1,col_2keys. - Toggle Auto type if you want
"123"→123and"true"→true; leave it off to keep every value a string. - Copy the output, or download it as a
.json/.csvfile.
How CSV and JSON differ, and what the spec says
CSV is a flat, row-and-column text format defined by RFC 4180, which registers the text/csv MIME type. JSON is a hierarchical key-value format defined by RFC 8259 / ECMA-404. CSV is denser because column names are stored once in the header; JSON repeats keys per object but supports nesting, arrays, and real types.
The escaping rules are where conversions break. RFC 4180 says any field containing a comma, double quote, or line break must be wrapped in double quotes, and a literal double quote inside that field is escaped by doubling it. This parser implements both rules exactly, so a value like "Park, Min" stays one field and "She said ""hi""" decodes to She said "hi".
"If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote."— RFC 4180, §2, rule 7
Need to compare these formats against YAML and XML before you commit to one? Read our JSON vs YAML vs XML guide, and for valid-JSON rules see the JSON validation & formatting guide.
Worked examples: CSV → JSON
Basic row · auto type on
id,name,active
1,Alex Rivera,true
→ [{ "id": 1, "name": "Alex Rivera", "active": true }]
Comma inside a quoted field
id,name
3,"Sara Khan, US"
→ [{ "id": 3, "name": "Sara Khan, US" }] — one value, not two
JSON → CSV · nested object
[{ "id": 1, "meta": { "tier": "pro" } }]
→ id,meta / 1,"{""tier"":""pro""}" — the nested object is JSON-stringified into one quoted cell
Edge case · big integer ID
With auto type on, 1234567890123456789 (19 digits) is kept as a string, not a number. It exceeds Number.isSafeInteger (253-1 = 9007199254740991), and coercing it would silently round it. Snowflake IDs and large account numbers survive intact. ZIP codes with leading zeros also stay strings — turn auto type off to guarantee it for every field.
Type inference reference
With Auto type enabled, this is exactly how each CSV string is coerced. Anything not matching a rule below stays a string.
| CSV value | JSON output | Rule |
|---|---|---|
| 123 | 123 | Safe integer (≤ 253-1) |
| 3.14 | 3.14 | Decimal number |
| true / True / TRUE | true | Boolean (3 casings) |
| null / NULL / (empty) | null | Null or empty cell |
| 01730 | "01730" | Leading zero → stays string |
| 12345678901234567890 | "12345678901234567890" | Exceeds safe integer → string |
Two behaviors most converters get wrong
Ragged rows keep all their columns. When converting JSON to CSV, the header is the union of every key across all rows in first-seen order — not just the first object's keys. If row 1 has id, name and row 5 adds email, you get all three columns; missing cells are emitted empty. Naive converters read only the first row's shape and silently drop later fields.
A quote mid-field is treated literally. RFC 4180 only assigns special meaning to a double quote at the start of a field. So 5" in length,5" pipe is read as the literal text 5" pipe, not a malformed quoted field — matching how Excel handles stray quotes, so your data round-trips instead of erroring.
Related data & conversion tools
Validate & pretty-print the JSON output
JSON DiffCompare two converted JSON files
JSON Schema GeneratorInfer a schema from your JSON array
JSON to TypeScriptGenerate typed interfaces from rows
JSON / YAML ConverterConvert JSON to YAML and back
YAML ValidatorCheck YAML syntax against the spec
XML FormatterIndent and validate XML payloads
SQL FormatterFormat the queries that load your data
Case ConverterNormalize column names (snake ↔ camel)
Markdown Table GeneratorTurn CSV rows into a Markdown table
Base64 EncoderEncode data for transport or embedding
All ToolsBrowse the full toolk utility hub
Last updated: September 15, 2026 · Runs 100% in your browser — no uploads, tool input is not sent to Toolk.
Frequently asked questions
Why does my 19-digit ID stay a string after conversion?
With auto type on, integers beyond Number.isSafeInteger (2^53 − 1) are deliberately kept as strings, because coercing them to a JavaScript number would silently round the last digits. Snowflake IDs, big account numbers, and ZIP codes with leading zeros therefore survive conversion intact.
What happens to nested objects when converting JSON back to CSV?
CSV is flat, so a nested object is JSON-stringified into a single quoted cell — the cell literally contains the object serialized with its quotes doubled per RFC 4180. Flatten your objects before converting if you need each field as its own column.
Which delimiters are supported besides commas?
Comma, tab, semicolon, and pipe — enough to cover European semicolon-CSV exports and TSV files. Quoting follows RFC 4180 in every mode: fields containing the delimiter, double quotes, or line breaks get wrapped, and inner quotes are escaped by doubling.
Is my spreadsheet data uploaded during conversion?
No. Parsing and serialization run locally in your browser, and Toolk's page analytics do not receive your rows or records. Tool input is not sent to Toolk, which matters for customer lists and financial exports.
How do I validate the JSON I just produced?
Paste it into the JSON Formatter at /tools/json-formatter — it parses, pretty-prints, and flags syntax errors, so you can confirm the array of objects is well-formed before loading it into an app or database.