CodeMash

CSV to JSON Converter Online — Free

Convert CSV data to a JSON array of objects. Auto-detects data types.

Ad Space

Frequently Asked Questions

How do I convert CSV to JSON online?

Paste your CSV data (with headers in the first row) into the input box. Our converter instantly generates a JSON array of objects using headers as keys.

Are data types automatically detected?

Yes, numbers, booleans, null values, and ISO dates in CSV cells are automatically converted to their proper JSON types instead of strings.

Can I convert Excel data to JSON?

Yes. Copy cells from Excel or Google Sheets and paste them in. The tab/comma-separated format is automatically detected and converted to JSON.

Privacy First: All processing happens directly in your browser. Your data never leaves your device.

About CSV → JSON

Turning a spreadsheet export into JSON is mostly about type inference and delimiter handling — the two places where a naive line-splitting parser gets it wrong.

Why you cannot just split on commas

A correct CSV parser is a small state machine, not a call to split on commas. Fields may be quoted, quoted fields may contain commas, and they may contain escaped quotes or newlines. A record can therefore span several physical lines while remaining a single row.

The parser here tracks quote state character by character, so an address field containing Berlin, Germany stays one value rather than becoming two columns.

Type inference and its limits

CSV is untyped — every cell is text. To produce useful JSON, values that look numeric become numbers, true and false become booleans, and empty cells become null. This is what you want almost all of the time, and occasionally exactly what you do not.

Watch for identifiers that are numeric but not numbers: a zip code of 01234 becomes 1234, and a long order ID may lose precision beyond the safe integer range. If a column is an identifier rather than a quantity, treat the conversion as lossy and check the result.

Header rows and duplicates

  • The first row is treated as the header and supplies the JSON keys.
  • Duplicate header names collide — the last column of a repeated name wins, because JSON objects cannot hold two identical keys.
  • Trailing blank lines are ignored rather than producing an object of nulls.
  • A UTF-8 byte order mark left by Excel becomes part of the first header name if not stripped, producing a key that looks correct but never matches.