Skip to content
UniKit

CSV ↔ JSON converter

Convert between CSV/TSV and JSON both ways: auto-detect comma, semicolon, tab or pipe delimiters, toggle the header row, infer numbers/booleans/null, handle quotes and embedded newlines, warn about inconsistent column counts and preview the first 10 rows as a table.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Result

What this tool does

  • Turn a CSV exported from Excel or Numbers into a JSON array you can feed straight into an API or a front-end mock.
  • Or go the other way: convert a JSON array of objects back into CSV so it can be reviewed in a spreadsheet.
  • Handle European files with semicolon separators, or messy cells containing commas, newlines and quotes — the delimiter is detected and parsing follows RFC 4180.
  • Debug JSON syntax errors: parsing does not use JSON.parse, so failures report the line, column and the actual reason (missing colon, unterminated string, trailing content and so on).

Example

Input

name,age,city
Alice,30,"Beijing, CN"
Bob,25,Shanghai

Output

[
  {
    "name": "Alice",
    "age": 30,
    "city": "Beijing, CN"
  },
  {
    "name": "Bob",
    "age": 25,
    "city": "Shanghai"
  }
]

A cell containing a comma has its quotes stripped by the parser first and is emitted as one string; 30 and 25 are losslessly inferred as numbers.

Frequently asked questions

Will type inference turn 007 into 7?

No. Inference is lossless: text becomes a number only when converting it back yields the exact original string (1 and -2.5 qualify, 007, 1.50 and 1e3 do not). Empty cells become null and true / false become booleans. Untick the option to keep everything as text.

What if a row has a different number of columns than the header?

You get a notice with the row number: missing cells are treated as empty (null) and extra cells are dropped. The conversion still completes, so one bad row never costs you the whole file.

Which structures does JSON to CSV support?

An array of objects (the header is the union of all keys in first-seen order) or an array of arrays. Anything else — a non-array at the top level, or an array mixing scalars — reports "expected an array of objects or an array of arrays".

What if the first row is data rather than a header?

Untick "first row is the header": columns become column1, column2, … and the first row is imported as data. Duplicate or blank header names are suffixed automatically (name_2, column3) so the output never has duplicate keys.

Is my data uploaded anywhere?

No. Parsing, conversion and serialisation all run in your browser, the page makes no network requests, and it works offline — safe for sensitive pastes.

Keywords:csvtsvcsv 转 jsonjson 转 csvcsv to jsonjson to csv分隔符delimiter表格convert

Related tools