CSV to JSON Converter

Paste CSV or drop a file and get clean JSON. The delimiter is detected for you, numbers and booleans are typed, and your data stays in your browser.

CSV input

JSON output

Your JSON will appear here. Paste CSV on the left or press Load sample.

Options

How to convert CSV to JSON

  1. Add your CSV. Paste it into the input box, drop a .csv file onto the page, or press Load sample to see how it works.
  2. Check the preview. The table shows the first 100 records. If the columns look wrong, the delimiter is usually the reason, so pick it by hand under Options.
  3. Copy or download. Copy JSON puts the text on your clipboard. Download JSON saves a .json file, or a .jsonl file when you choose JSON Lines.

The conversion updates as you type or change an option, so there is no convert button to press.

CSV in

id,name,city,zip
1,Ava,Austin,00501
2,Omar,"Lisbon, PT",1000-001

JSON out

[
  {
    "id": 1,
    "name": "Ava",
    "city": "Austin",
    "zip": "00501"
  },
  {
    "id": 2,
    "name": "Omar",
    "city": "Lisbon, PT",
    "zip": "1000-001"
  }
]

Choose how the JSON is shaped

The defaults suit most files: the first row becomes the keys, the delimiter is detected, and plain numbers and true/false values are typed. Each option below changes one thing.

OptionWhat it doesChange it when
Delimiter Auto-detect looks at the first lines, ignores anything inside quotes, and picks comma, semicolon, tab or pipe, whichever splits every line the same way. The file has a single column, or the preview shows everything in one column.
First row is the header On, the first row names the keys and you get an array of objects. Off, you get an array of arrays and every row is kept. The file has no column names.
Detect numbers, true, false and null Turns 42, -3.5 and 1e5 into numbers, and true, false and null into JSON values. Off, every value stays a string. The receiving system expects strings everywhere.
Decimal separator With Comma selected, 19,90 becomes the number 19.9. The file comes from a German, French or other European export.
Empty cells become An empty string, null, or no key at all for that record. Your API or database treats null differently from an empty string.
Trim spaces Removes spaces around each value. Header names are always trimmed. The export pads its values, as in " Austin ".
Rebuild nested JSON Turns user.name into {"user": {"name": ...}} and tags.0, tags.1 into an array. You are reversing a flattened file, or need an API-shaped payload.
Output format A JSON array, indented with 2 spaces, 4 spaces or tabs, or minified. JSON Lines writes one object per line. A bulk loader or log pipeline expects JSON Lines.

How values are typed, and what stays text

CSV has no types, so every cell arrives as text. When type detection is on, the converter only changes a value when doing so is safe. It never turns an identifier into a number that no longer matches the original.

CSV valueJSON resultWhy
42, -3.5, 1e542, -3.5, 100000Ordinary numbers.
00501"00501"A number would drop the leading zeros of a zip code or product code.
12345678901234567890"12345678901234567890"Numbers longer than 15 digits lose precision in JavaScript, so long IDs stay exact as text.
+4915112345"+4915112345"Phone numbers are identifiers, not quantities.
1,000 (quoted)"1,000"With a dot decimal separator this is not a plain number, so it is left alone.
true, FALSEtrue, falseMatched in any letter case.
nullnullThe word null becomes the JSON null.
(empty)""Or null, or no key, depending on your choice.

Semicolon CSV files and Excel exports

In countries that write a decimal with a comma, such as Germany and France, Excel saves CSV files with semicolons between the columns, because a comma would be ambiguous. Open one of those files in a tool that expects commas and every row ends up in a single column.

This converter reads the first lines of your file and picks the delimiter itself, so a semicolon file works without any setup. For prices such as 19,90, also set Decimal separator to Comma so they become numbers.

If accented letters or other non-English characters look wrong, the file is probably not saved as UTF-8. In Excel, choose Save As and then CSV UTF-8 (Comma delimited), and load the new file.

Build nested JSON from a flat CSV

CSV cannot nest, but you can describe nesting in the column names. Turn on Rebuild nested JSON and a dot in a header becomes a level of structure. A number in the last position becomes an array index.

This is the exact reverse of the JSON to CSV converter, which writes nested objects as dotted column names. A file converted that way comes back with its original shape.

When one column is named a and another a.b, a name cannot hold both a value and an object, so both columns stay as plain keys instead of overwriting each other.

CSV in

id,user.name,user.city,tags.0,tags.1
1,Ava,Austin,new,vip

JSON out

[
  {
    "id": 1,
    "user": {
      "name": "Ava",
      "city": "Austin"
    },
    "tags": [
      "new",
      "vip"
    ]
  }
]

What this converter does

Private by design
The conversion runs in your browser with JavaScript. Your CSV is not sent to a server, so it is safe to use with internal or customer data.
Follows the CSV quoting rules
Quoted fields, doubled quotation marks and line breaks inside a quoted field are read the way RFC 4180 describes. Windows, Unix and old Mac line endings all work.
Finds the delimiter
Comma, semicolon, tab and pipe files are detected automatically, and you can override the choice at any time.
Clear error messages
A quote that is never closed is reported with the line where it starts. Rows with a different number of fields than the header are counted and flagged instead of silently dropped.
Exact values
Leading zeros, phone numbers and IDs longer than 15 digits stay as text, so what you read in the JSON matches what was in the file.
Large files
Files up to 300 MB can be loaded. In our tests a 200,000-row file converted in about a second. The preview shows the first 100 records, and copy and download include everything.

Frequently asked questions

How do I convert CSV to JSON?

Paste your CSV into the input box, or drop a .csv file onto the page. The JSON appears on the right straight away. Press Copy JSON, or Download JSON to save a file. There is no convert button, and the result updates when you change an option.

Is my CSV uploaded to a server?

No. The file is read and converted by JavaScript in your browser tab, and nothing is sent anywhere. That makes it safe for customer lists, orders and other internal data. Closing the tab discards everything.

Why is everything in one column or one key?

The delimiter is wrong. CSV files can separate columns with commas, semicolons, tabs or pipes. Auto-detect usually gets it right, but a file with a single column or very uneven lines can fool it. Open Options and choose the delimiter yourself.

How do I convert a semicolon-separated CSV from Excel?

Leave the delimiter on Auto-detect, or choose Semicolon. Excel in countries that write decimals with a comma saves files this way. If prices look like 19,90, also set Decimal separator to Comma so they become the number 19.9.

Why are some numbers in quotes in the JSON?

On purpose. Values with leading zeros, such as the zip code 00501, and numbers longer than 15 digits would be changed if they became JSON numbers, so they stay as text. A value with a plus sign, like a phone number, also stays text. Turn off Detect numbers if you want every value as a string.

Can I convert a CSV that has no header row?

Yes. Untick First row is the header and the output becomes an array of arrays, one per row, with every row kept. You can also add a header line to the CSV and convert it normally to get objects with named keys.

How do I get nested JSON from a flat CSV?

Name your columns with dots and tick Rebuild nested JSON. A header such as user.name becomes {"user": {"name": ...}}, and tags.0 and tags.1 become an array. It reverses the output of the JSON to CSV converter.

What is JSON Lines and when should I use it?

JSON Lines, also called NDJSON, writes one complete JSON object per line instead of one big array. It is easy to stream and append to, so many bulk loaders and log tools prefer it. Choose JSON Lines under Output format and the download gets a .jsonl extension.

How are quotes and line breaks inside a field handled?

As the CSV standard, RFC 4180, describes. A field wrapped in double quotes can contain the delimiter and line breaks, and a doubled quotation mark inside it stands for one quote. If a quote is opened and never closed, the converter shows the line where it starts so you can fix it.

Which file encoding does it expect?

UTF-8, which is what most modern tools write. A byte order mark at the start of the file is removed. If accented letters look garbled, save the file as CSV UTF-8 from Excel or your editor and load it again.

How large a CSV can I convert?

Files up to 300 MB can be loaded, and in our tests a 200,000-row file converted in about a second. The limit in practice is your device's memory, because everything happens in the browser. For very large files, split them and convert the parts.