Utilo

CSV to JSON Converter – Free, Online, Private

Parse a CSV table into a JSON array of objects, with numbers and booleans detected automatically when the cell is unambiguous.

Input
Output

How to convert CSV to JSON

  1. Paste CSV including the header row. The sample is three people.
  2. Each data row becomes an object keyed by the header.
  3. Copy the JSON array. Empty cells become empty strings unless dynamic typing promotes them.

Headers become keys

The first record is the header. Each later record becomes an object. Header cells are used as keys without lowercasing, so ID and id stay distinct. Duplicate headers are a CSV smell; the parser keeps the last value for a repeated name. A short row is padded with empty fields. A long row's extra cells are ignored by the header-based parse, so keep the column count stable. Quoted fields may contain commas and newlines. Two consecutive quotes inside a quoted field are one quote character.

Dynamic typing

Cells that look like integers or decimals become JSON numbers. true and false become booleans, compared case-insensitively by the parser's dynamic typing. Everything else stays a string, including zip codes with leading zeros if you quoted them or if they are not plain integers. A phone number like 0123 can lose the zero if it is unquoted, because it is a number. Quote the column in the CSV, or fix the types after conversion, when leading zeros matter. Empty fields stay empty strings rather than null, which is easier to distinguish from the word null.

Worked example

The sample header is id,name,active,city. Three data rows become a JSON array of length three. id values 42, 43 and 44 are numbers. active is a boolean. Names with spaces stay one string because they contain no comma. If you add a quoted bio field with a line break, that line break survives inside the JSON string. The output is pretty-printed with two spaces so you can read it before posting it to an API or saving it as a fixture.

Files this page is bad at

European CSV that uses semicolons and decimal commas is not the default. This parser expects commas and dots. Spreadsheet exports that include a title row above the header will treat the title as column names; delete that row first. Binary xlsx workbooks are not CSV; export a sheet as CSV, then paste. The conversion runs locally, which matters when the sheet is a payroll extract or a list of unreleased hostnames.

Frequently asked questions

Does the first row have to be a header?

Yes. This converter always treats the first record as object keys. A headerless file would use the first data row as names, which is rarely what you want.

Can fields contain commas?

Yes, if the field is wrapped in double quotes. Commas inside quotes do not split the row.

Why did my identifier become a number?

Unquoted numeric cells are parsed as numbers. Quote the field or convert it back to a string if you need to keep leading zeros.

Is the file uploaded?

No. Papa Parse runs in the page. The CSV stays in the tab.