CSV to JSON

Convert CSV.

Loading tool…

What is CSV, and why is it harder than it looks?

CSV means comma-separated values: one record per line, fields separated by commas. It is the oldest and most widely supported data interchange format there is, and it was standardised only loosely, which is where the difficulty comes from. Fields containing a comma must be quoted. Quotes inside a quoted field are escaped by doubling them. Records may contain line breaks inside quotes. And many European exports use semicolons instead of commas because the comma is their decimal separator.

Converting to JSON means parsing all of that correctly, then deciding what the data means: the first row is normally a header supplying the keys, and every subsequent row becomes an object. Types are the other decision — CSV has none, so 42 and true arrive as strings unless the converter infers otherwise, and leading zeros in things like postcodes must be preserved rather than silently turned into numbers.

Why we built this tool

The typical job is feeding a spreadsheet export into something that speaks JSON: seeding a database, driving a test fixture, posting records to an API, or loading data into a JavaScript front end.

Those exports are usually the real thing — customer lists, order histories, employee records. Uploading them to a converter site is a data transfer you would struggle to justify in a privacy review. Our parser runs in your browser, so the file is read from disk into the tab, converted with your own CPU, and written back out. Nothing is transmitted, there is no row cap, and large files are limited only by your device's memory rather than someone else's upload policy.

Tips and common mistakes

  • Check the delimiter before converting; European exports frequently use semicolons.
  • Postcodes, phone numbers, and account references should stay strings — automatic number detection strips their leading zeros.
  • A header row with duplicate or blank column names produces confusing keys, so tidy it first.
  • Fields containing commas must be quoted in the source; unquoted ones will split into extra columns.

Open CSV to JSON with a link

CSV to JSON can be handed its input by the link that opens it, so the page arrives with the work already done. This is meant for assistants and scripts: if a chatbot, an editor extension, or a command-line agent already holds your content, it can build a link instead of asking you to copy and paste into a box.

The payload rides in the fragment — the part of a URL after the #. Browsers never send the fragment to a server, so anything handed over this way stays on your device exactly as a dropped file would. A link that uses the query string instead is rewritten into the fragment by the page before any analytics or ad script can read the address.

Prefix any field with gz#gztext= — to pass it as gzip-compressed base64url, which fits roughly five to ten times more into the same link. Links stay reliable up to about 8,000 characters; past that, chat apps and address bars start truncating them, and the page says so rather than loading half a document.

One exception to the privacy rule: ?url= tells the page to download the input from an address. That request goes from your browser straight to that server — not through ours — but it does leave your device, and it only works if the server allows cross-origin requests.

With My Gadgets installed as an app, a .csv file opened from your desktop lands straight in this tool. The file is read locally, exactly like a drop.

  • #text= — the text to work on

Example: https://mygadgets.ink/tools/csv-to-json/#text=...

Quick start: using CSV to JSON

  1. Paste your CSV or load the file above.
  2. Confirm the delimiter — comma or semicolon — and whether the first row is a header.
  3. Run the conversion and inspect the first object in the output.
  4. Check that numeric and boolean-looking fields have the types you want.
  5. Copy the JSON or download it for use in your project.

Going the other way is JSON to CSV, and JSON Formatter will pretty-print the result.

Related Developer Tools

Browse all Developer Tools →