ToolsForWeb

Saved

Tap ☆ on any tool to keep it here.

toolsforweb

CSV / JSON Converter

Convert CSV to JSON or JSON to CSV, with delimiter auto-detection and correct quoting.

Runs in your browser — nothing is uploaded

Loading tool…

Results are provided as is, for general information. Check anything important before relying on it. See the Terms of Use.

About this tool

Convert tabular data either way. CSV → JSON turns rows into objects using the first row as the header (or into plain arrays when it is not), with commas, semicolons, tabs and pipes auto-detected as the delimiter and an override when detection is wrong. Numbers and booleans are recognized automatically and can be kept as strings. JSON → CSV takes an array of objects, unions the keys across rows into a header, and serializes nested objects and arrays as JSON strings. Quoting follows RFC 4180: fields containing the delimiter, quotes or newlines are quoted and internal quotes are doubled, so spreadsheet round-trips survive.

When to use it

Turning a spreadsheet export into JSON an API or script can consume.
Flattening a JSON array of records into CSV for Excel or Sheets.
Cleaning up semicolon- or tab-separated exports from European or legacy tools.
Checking that tricky CSV — quoted commas, embedded newlines — parses the way you expect.

Questions

How does delimiter auto-detection work?

It counts commas, semicolons, tabs and pipes on the first non-empty line, ignoring anything inside quoted fields, and picks the most frequent. If nothing is found it falls back to comma. You can always override it manually.

Why did my 007 become a string?

Deliberately. Values with leading zeros look like numbers but usually are not — zip codes, phone parts, IDs — so the number recognizer only accepts plain integers and decimals without a leading zero. Untick "Convert numbers & booleans" to keep everything as text.

What happens to empty cells?

They become empty strings, never null, in both directions. A missing key in a JSON row becomes an empty CSV cell, and an empty CSV cell stays "" in the JSON output.

Why did conversion fail with an 'unclosed quote' error?

Somewhere in the file a field opens with a quote and never closes it: the parser keeps reading, the row count stops matching the column count, and the run aborts with the line the quote started on rather than a wrong output. The usual culprit is a pasted cell containing a single double-quote mark — a dialect marker, an inch sign — typed inside unquoted text. Double the quote inside quoted fields or remove it; a CSV file exported by a spreadsheet will not have this problem.

What decides whether a cell becomes a number, a boolean or a string?

A strict recognizer. Clean integers and decimals become JSON numbers; bare true/false (any capitalization) become booleans; everything else stays a string. The recognizer deliberately rejects values with leading zeros, so 007 remains text — the correct call for zip codes, phone fragments and IDs that merely look numeric. An option keeps everything as strings when pure text fidelity is what the downstream tool wants.

What happens to quoted fields containing commas or line breaks?

The parser is an RFC 4180 state machine, so quoted fields survive intact: a cell may contain the delimiter, doubled quotes, even real CR/LF characters without splitting the row. An unclosed quote is reported with the line it started on rather than silently swallowing the rest of the file. Hand-built parsers that split on commas exist in the wild — this is the tool to check a suspicious CSV against.

How are nested objects and arrays handled on the way to CSV?

They are serialized as JSON strings inside their cells — ["a", "b"] travels as that literal text. The header is the union of keys across all rows, with missing keys left as empty cells. Round-tripping brings the string back, not the original array, so genuinely hierarchical data has a structure ceiling: CSV is a flat grid, and pretending otherwise would corrupt the round-trip.

What happens to empty cells and missing keys?

They become empty strings, never null — in both directions, consistently. That is a deliberate simplification: CSV has no null literal, so inventing one via empties would make round-trips lossy in a way you could not see. The cost is that 'no value' and 'empty value' are indistinguishable downstream; if that distinction matters, keep the JSON form.

Does the data stay local?

Yes — parsing and serialization run entirely in the browser, and no row ever leaves the page. That is what makes the tool safe for data you could never paste into a hosted converter: customer lists, internal exports, anything covered by an agreement. The trade is you do the pasting; the upside is nobody else ever holds the rows.

Related tools