Skip to content
GongsiMap Tools

Convert CSV to JSON

Need spreadsheet data as fixtures, seed data or a config file? This tool reads the header row as keys and turns every following row into a JSON object, converting numbers and booleans if you want.

Everything happens in your browser. The CSV is not uploaded anywhere.

Your files and text are processed only in this browser. Nothing is uploaded or stored on a server.

How to use

  1. Open a CSV file (up to 50 MB) or paste CSV text.
  2. Confirm the detected delimiter and encoding.
  3. Choose whether the first row holds keys and whether to infer types.
  4. Pick pretty or minified output, then copy or download.

Features and limits

  • The delimiter is detected automatically; text is read as UTF-8, or as Windows-1252 when the file isn't UTF-8.
  • With the header option, empty column names become column_N and duplicate names get a suffix like _2, so no key is overwritten.
  • Without the header option, the output is an array of arrays, one per row.
  • Type inference converts numbers, true/false and empty cells (null). Values with leading zeros and integers over 15 digits stay strings to avoid losing information.
  • Output is pretty-printed with 2 spaces or minified to one line.

FAQ

Why are my numbers still strings in the JSON?

Type inference is off, or the value has a leading zero (like 00123) or more than 15 digits. Those are kept as strings on purpose so they aren't changed.

Can JavaScript lose precision on large ID numbers?

Yes. JavaScript numbers are only exact up to about 15–16 digits, so longer integers would be rounded. That's why they stay strings here.

Can I convert a CSV without a header row?

Yes. Turn off the header option and you'll get an array of arrays with every row included.

What happens to duplicate column names?

The second occurrence is renamed with a _2 suffix (then _3, and so on) so each value keeps its own key.