Skip to content
TNToolsNexus

CSV ⇄ JSON converter

Convert CSV to JSON objects (or arrays) and JSON back to CSV — RFC 4180 quoting done right, comma/semicolon/tab, copy or download.

Direction

Your data never leaves your browser — conversion happens on your device.

Convert CSV to JSON and back with the quoting rules done properly — embedded commas, doubled quotes, and multi-line fields survive both directions, because the parser is a real RFC 4180 state machine rather than a split-on-comma.

How to convert

  1. Pick the direction: CSV → JSON or JSON → CSV, and the delimiter (comma, semicolon, tab).
  2. Paste. With headers on, CSV rows become JSON objects keyed by the first row.
  3. Copy the result or download it as a file.

Why naive converters corrupt data

Split every line on commas and "Smith, John",42 becomes three fields. Real CSV wraps such values in quotes, escapes quotes by doubling them, and even permits newlines inside a quoted field — rules set down in RFC 4180 that spreadsheet exports follow and quick scripts don’t. This converter parses those rules character by character, and its JSON→CSV direction re-quotes by the same rules — so a round trip returns exactly what went in. Values stay strings on the way to JSON, deliberately: type-guessing is how leading zeros vanish from ZIP codes.

The two directions, in practice

CSV → JSON feeds exports into code: an API body, a fixture file, a quick script over spreadsheet data. Header mode produces the array-of-objects shape everything expects; ragged rows pad safely. JSON → CSV goes the other way — API output into something Excel opens — unioning keys across objects so differing shapes still produce one coherent header row. Pretty-print or minify the JSON side with the JSON formatter, and clean duplicate rows with the dedupe tool before converting.

Private by design

CSV files are customer lists and financial exports more often than not. Conversion runs entirely in your browser — nothing is uploaded, logged, or kept.

Last updated:

Frequently asked questions

How are commas inside values handled?
Correctly — that's the whole job. Fields wrapped in quotes may contain commas, newlines, and doubled quotes ("") per RFC 4180; the parser here is a real state machine, not a split-on-comma, so "Smith, John" stays one field. The JSON→CSV direction quotes its output by the same rules.
Objects or arrays — what JSON do I get?
With "first row is headers" on (the default), each data row becomes an object keyed by the headers — what APIs and scripts usually want. Off, you get an array of arrays, faithful to the grid. Ragged rows fill missing cells with empty strings rather than crashing.
My file uses semicolons (European Excel) — supported?
Yes — pick semicolon (or tab for TSV) in the delimiter select. Excel in many locales exports semicolon-separated files because the comma is the decimal separator there.
Are numbers converted or kept as text?
CSV→JSON keeps every value as a string — CSV has no types, and guessing wrong ("007" becoming 7, ZIP codes losing zeros) causes the classic silent data bugs. Convert types downstream, deliberately. JSON→CSV writes numbers and booleans as-is.
Is my data uploaded anywhere?
No — parsing and conversion run entirely in your browser, which matters for the customer exports this tool usually sees.

Related tools

JSON Formatter

Format, validate, and minify JSON as you paste — 2/4-space or tab indentation, clear syntax errors, copy or download. Private.

Regex Tester

Test regular expressions live: highlighted matches, indices, capture groups (named too), flag toggles, and plain error messages.

Remove Duplicate Lines

Delete duplicate lines from lists and logs while keeping the original order — with case and whitespace options and a removal count.