DevToolCase
Sign in Sign in

Convert CSV to JSON

Turn a CSV file (Excel, database export…) into JSON objects named by the header row, with the separator detected and numbers typed.

Share this result

Encrypted in your browser. The key stays in the link, after “#”: only the people you give it to can read it, not even DevToolCase.

The link works for

Sign in for longer links or links without expiry, and to find them in your account.

Runs entirely in your browser: nothing you type is sent or stored.

From a spreadsheet to JSON

Exports from Excel, Google Sheets or a database are often CSV files. Converted to JSON, they become an array of objects, one per row, named after the header row: ready for a test fixture, an API call or a script.

Separators and quotes

The separator is found from the first line: comma, semicolon (Excel in languages that write decimals with a comma, such as French), tab or pipe.

A field holding the separator, a quote or a line break is written between double quotes, a quote inside it being doubled: "Pen, blue", "Say ""hi""".

Numbers and empty cells

  • With “Numbers and booleans as such”, 42 becomes a number, true a boolean and an empty cell null.
  • Values with leading zeros, such as postcodes (01000) or product codes, stay text, as do identifiers too long for a JSON number.
  • Untick the option to keep every value as text.

The other way: JSON to CSV.

Add this browser’s favorites to your account?

This browser has 0 favorites that your account does not have:

Either way, this browser keeps its favorites: you find them again after signing out.