Code Beautifier

CSV to JSON

Convert CSV tabular data into structured JSON objects or arrays with automatic type detection. · Updated

Options
Delimiter:
JSON Indent:
text
json
Draft saved locally.

CSV to JSON is the bridge between spreadsheets and APIs. Auto-typing and delimiter detection keep conversions fast while everything stays on-device for sensitive exports.

Common errors and fixes

Too few fields

A row has fewer columns than the header. Pad empty cells or fix the delimiter.

Unescaped quote

Wrap fields containing commas in double quotes and escape quotes by doubling them.

Unable to auto-detect delimiter

Pick Comma, Tab, Semicolon, or Pipe explicitly in Options.

No rows parsed

Ensure the paste includes a header row or disable “First row is header” for raw matrices.

Options

OptionDescription
First row is headerWhen checked, the first row columns become keys for an array of JSON objects. When unchecked, outputs a 2D array of rows.
Auto-detect numbers & booleansConverts numeric values to numbers (125000) and 'true'/'false' to booleans instead of raw strings.
DelimiterSpecify the column separator or let the parser detect it automatically.
JSON IndentIndentation spaces for formatted JSON (0 for minified JSON).

FAQ

How does CSV to JSON handle column headers?

When 'First row is header' is enabled, column names from line 1 become the keys of each JSON object in an array.

Can I convert CSV to a 2D JSON array instead of objects?

Yes. Uncheck 'First row is header' to output an array of string/number arrays representing raw grid cells.

Does it convert numbers and booleans automatically?

Yes. With 'Auto-detect numbers & booleans' enabled, numeric strings are cast to JavaScript numbers and true/false to boolean values.

Can it parse Tab-separated (TSV) or semicolon-separated files?

Yes. The delimiter auto-detection detects tabs, commas, semicolons, and pipes automatically, or you can pick one explicitly.