CSV to JSON

Paste a spreadsheet export and get JSON back, the text format programs use to pass data around; paste JSON and you get a table again. Quoted fields, commas inside values and semicolon-separated files are all handled.

How to use it

Nothing is uploaded here: the conversion runs inside the browser, so a customer list or an order export never leaves the machine you are working on.

  1. Choose the direction CSV to JSON, or JSON to CSV. The boxes and the download name change to match.
  2. Paste or open your file Paste into the left box, or press "Open a file" to load one from your computer.
  3. Check the first-row setting Leave "First row is the column names" ticked if your file starts with a header row, which most do.
Full instructions

CSV in

JSON out

In depth

Converting between CSV and JSON without losing data along the way

CSV is the language of spreadsheets. JSON is the language of web APIs and modern software. Moving data from one format to the other sounds easy until a comma inside a name splits a row in half, or a postcode loses its leading zero. This article covers how the CSV to JSON tool handles those tricky cases, walks through a real conversion in both directions, and explains every setting on the page.

Screenshot: Moving data between spreadsheets and code
Moving data between spreadsheets and code as it appears when the page opens.

Why these two formats keep meeting

A marketing team exports a contact list from their CRM. It arrives as a CSV file. The developer building the email tool needs it as JSON. A data analyst downloads API results in JSON and wants to open them in a spreadsheet. A student scrapes a table from a website and gets JSON back, but the assignment needs a CSV for the chart tool.

These conversions happen every day across every industry. They are simple in principle - rows become objects, columns become keys - but the details are where files break. A good converter handles quoted fields, mixed separators, nested values and character encoding without the user having to think about any of it.

Choosing the direction

The Direction dropdown at the top has two options: CSV to JSON and JSON to CSV. Picking one changes the labels on both text boxes and the name of the downloaded file. If you chose CSV to JSON, the left box says CSV in and the right says JSON out. Switch to JSON to CSV and they swap.

You can change direction at any time. If you paste JSON into the left box while CSV to JSON is selected, just flip the dropdown to JSON to CSV and the conversion runs in the right direction.

Loading your data

Paste text straight into the left box, or press Open a file to pick a file from your computer. The file is read locally by your browser and never sent to a server. The Try an example button loads a small sample so you can see the output format before pasting your own data.

If your CSV was copied from a spreadsheet, it arrives as tab-separated text. The page handles this automatically. You do not need to convert tabs to commas first.

The separator setting and automatic detection

The Separator dropdown defaults to Work it out for me. The tool looks at the first few lines and decides whether the file uses commas, semicolons, tabs or pipes. It gets this right almost every time.

If it guesses wrong, pick the separator by hand. Semicolon-separated files are common across much of Europe, where the comma is already used as the decimal mark. Tab-separated files come from database exports and from copying a range in most spreadsheet software. Pipe-separated files are rarer but show up in some data feeds.

Three checkboxes that shape the output

First row is the column names should be ticked when the CSV starts with a header row, which most files do. When ticked, the JSON objects use those headings as keys. When unticked, the keys are numbered: column 0, column 1, and so on.

Turn numbers into numbers controls whether values that look like numbers become JSON numbers. With it on, the string 42 becomes the number 42 in the JSON. Values with a leading zero, a plus sign, or spaces are left as strings, so postcodes like 01onal and phone numbers like +44 7700 900000 survive.

Lay the JSON out neatly adds line breaks and indentation to the output. Turn it off if you need compact JSON for an API call where every byte counts. The difference is cosmetic - the data is the same either way.

A worked example: CSV to JSON

Suppose you have a small product list: name, price, in_stock followed by rows Widget 9.99 true, Gadget 24.50 false, Bolt 0.75 true.

Paste it with First row is the column names ticked and Turn numbers into numbers ticked. The right box shows a JSON array of three objects. Each object has three keys: name as a string, price as a number, and in_stock as the text true or false.

Notice that 0.75 kept its leading zero because it is a decimal number, not a zero-padded string. The tool only strips leading zeros from values that would lose meaning, like 007 becoming 7. A decimal like 0.75 is left alone because removing the zero would change the number.

A worked example: JSON to CSV

Now flip Direction to JSON to CSV. Paste this JSON: an array of two objects, one with keys city and population, the other with keys city, population and country. The first object has no country field.

The CSV output has three columns: city, population, country. The first row leaves the country cell empty because the original object had no such key. The tool collects column names from every object, not just the first one, so nothing is dropped.

How commas inside values are handled

The hardest part of CSV is that a comma can mean two things. It usually separates columns, but inside quotation marks it is just punctuation. A name written as Reyes, Daniel is one field if it is quoted, two fields if it is not.

Simple converters split on every comma and break quietly. This tool reads the quotation marks properly. A quoted value can contain commas, line breaks and even quotation marks of its own (doubled up as two in a row). All of these survive the round trip.

This matters most with address fields. A single cell might hold 12 High Street, Floor 3, London and that should stay as one column, not three. If your conversion is splitting addresses into pieces, the source file is probably missing its quotation marks, and the fix is to re-export it with quoting turned on.

What happens to nested JSON

A JSON value can be a string, a number, true, false, null, a list, or another object. CSV cells can only hold flat text. When the tool hits a list or an object inside a JSON value, it writes it into the cell as a JSON string rather than throwing it away.

That means a cell might contain the text [1, 2, 3] or {"x": 10}. It is not pretty, but the data is preserved. If you need to flatten nested JSON into separate columns, you would do that in a script or a spreadsheet after the conversion.

Downloading for Excel and character encoding

Press Download to save the result as a file. The downloaded file includes a small marker at the start called a byte order mark. This tells Excel that the text is encoded as UTF-8, which is the standard that supports accented characters, Asian scripts and emoji.

Without that marker, Excel on some systems guesses the wrong encoding and accented characters turn into nonsense. The Copy button does not add the marker because the clipboard does not need one. If you plan to open the file in Excel, always use Download rather than Copy and paste.

Common mistakes and quick fixes

The output looks wrong or has too many columns. Your CSV probably has unquoted commas inside a value. Re-export the source file with proper quoting, or switch the separator to something that does not appear in the data, like a tab.

All values are strings even though they are numbers. Check that Turn numbers into numbers is ticked. If the values have currency symbols or percent signs, those make them text, not numbers. Strip the symbols before converting.

The JSON has no key names, just numbered columns. First row is the column names is unticked. Tick it and the headers from your first row become the JSON keys.

When to use something else

This tool handles flat tables. If your JSON is deeply nested with objects inside lists inside objects, the CSV output will be cluttered with stringified values. A dedicated JSON flattening tool or a short script would serve better.

For very large files - hundreds of megabytes - the browser may run out of memory. There is no server queue to offload to, so the limit is whatever your device can hold. A command-line tool like jq or csvkit handles larger volumes without loading everything into the page at once.

Privacy and where your data stays

The conversion runs entirely in your browser. Nothing is uploaded, nothing is logged, and no server is involved. You can load the page, disconnect from the internet, and keep converting files for as long as the tab is open. This makes it safe for confidential data that must not travel over a network. Whether you are converting a list of customer orders, a payroll extract, or a medical dataset, the data never touches another computer. Close the tab and it is gone.

Help

Moving data between spreadsheets and code

Nothing is uploaded here: the conversion runs inside the browser, so a customer list or an order export never leaves the machine you are working on. Paste text in one format and take the other away, whichever direction you need, since the same page does both halves of what is really one job.

Choose the direction

CSV to JSON, or JSON to CSV. The boxes and the download name change to match.

Paste or open your file

Paste into the left box, or press "Open a file" to load one from your computer.

Check the first-row setting

Leave "First row is the column names" ticked if your file starts with a header row, which most do.

Copy or download the result

The right-hand box updates as you type. Copy it, or download it as a file.

Why a comma in a name does not break this

The hard part of CSV is that a comma can mean two different things. It usually separates one column from the next, but inside quotation marks it is just a comma in the text. A name written as "Reyes, Daniel" is one column, not two. The same goes for line breaks: a full address can sit inside a single cell, spread over three lines, and it is still one cell. Simple converters split on every comma they see and quietly turn one row into two, or shift every column along by one. This tool reads the quotation marks properly, so quoted commas, quoted line breaks and doubled quotation marks all survive the trip. It also spots files that use a semicolon or a tab instead of a comma, which is normal in much of Europe and in database exports.

Good to know

Leading zeros are kept as text

A value like 007 or a postcode stays a string. If numbers were converted blindly, the zeros would be stripped and the data would be wrong.

Every column is kept

When JSON records do not all have the same fields, the columns are collected from every record, not just the first one. Nothing is dropped.

Download rather than copy for Excel

The downloaded file includes a small marker that tells Excel the text is UTF-8, so accented characters open correctly.

Nested data becomes text

A JSON value that is itself a list or an object has no natural place in a spreadsheet cell, so it is written in as text rather than thrown away.

Common questions

How do I convert CSV to JSON?
Paste your CSV into the left box. The JSON appears on the right straight away. Keep "First row is the column names" ticked if your file has a header row.
Can it handle commas inside a value?
Yes. A value wrapped in quotation marks can contain commas, line breaks and quotation marks of its own, and it is treated as one cell.
My file uses semicolons instead of commas. Will it work?
Yes. The separator is worked out from your file automatically, and you can also set it by hand.
Will my phone numbers and postcodes be damaged?
No. Only values that are unambiguously numbers are converted. Anything with a leading zero, a plus sign or a space stays as text.
Is there a size limit?
Only what your browser can hold in memory. There is no upload, so there is no server limit and no queue.
Is my data sent anywhere?
No. The conversion runs inside this page on your own device. You can disconnect from the internet after the page loads and it will still work.