oktools

CSV to JSON & JSON to CSV Converter

Convert CSV to JSON and JSON back to CSV in your browser. Reads comma-, semicolon- and tab-separated (TSV) data, including Excel exports with a byte-order mark, with quoted fields and embedded line breaks handled as RFC 4180 describes. Pick the delimiter and quote character or let them be detected, keep the first row as the header or get arrays, and optionally detect numbers, booleans and null.

Frequently asked questions

How do I convert CSV to JSON?

Paste the CSV in with CSV to JSON selected. With "First row is header" ticked the first row is read as the field names and every row after it becomes one object in an array, which is the shape almost every API and script expects; untick it to get a plain array of arrays instead. The result appears as you type, and a row with more or fewer cells than the header is listed under the output rather than silently padded or cut.

Can it convert JSON back to CSV?

Yes — switch the direction. A JSON array of objects is flattened to a header row built from the union of every key, so rows that are missing a field still line up under the right column instead of shifting everything along by one. An array of arrays is written out row by row as it is.

Which delimiters are supported?

Comma, semicolon, tab and pipe, and the delimiter is detected from the first line unless you pick one. The quote character can be " or '. That covers semicolon-separated files — the default Excel export in much of Europe — tab-separated (TSV) data pasted straight out of a spreadsheet, and the UTF-8 byte-order mark Excel puts at the start of a file, which is stripped before parsing.

How are commas, quotes and line breaks inside a value handled?

As RFC 4180 specifies. A field wrapped in quotes may contain the delimiter, a newline or a doubled quote character standing for a literal quote, and all of that is parsed rather than split blindly on commas. A quote in the middle of an unquoted value, such as 5'10", is taken literally. Writing CSV works the same way round: any value that needs quoting gets it.

Why are my numbers coming out as strings?

Because CSV has no types — every field is text, and guessing which columns are numbers is how leading zeros disappear from postcodes and how long IDs turn into rounded floats. By default values are kept as written so nothing is silently corrupted. Tick "Detect numbers, booleans and null" to convert cells that look like 42, 3.5, true, false or null; values with leading zeros and integers too long for a JavaScript number are still left as text.

Is my spreadsheet data uploaded anywhere?

No. The whole tool is JavaScript running in your own browser, so nothing you type or paste is sent over the network, written to a log or attached to an analytics event. You can confirm it by opening the network tab and watching it stay empty while you work.