Skip to contentSkip to the inputSkip to the result

CSV → JSON

Read comma-separated data as JSON records.

Loading tool

Instructions

CSV → JSON

How to use

  1. Paste CSV with a header row, convert and copy or download JSON.

Supported input

  • Commas, tabs, semicolons or pipes are detected.
  • Quoted cells are supported; repeated headers are numbered (name_2).

Input example

name,age followed by Ada,30

Result example

[{"name":"Ada","age":"30"}]

Troubleshooting

  • Check required inputs, numeric ranges and the selected conversion direction.

How it works

  • Read comma-separated data as JSON records.

From spreadsheet rows to JSON objects: the rules that decide the output

When a table has to become JSON

  • A product list kept in a sheet is needed as seed data or as a mock API response
  • Translators hand back strings in Excel and the app wants a language file
  • Survey results exported as CSV should go straight into a JavaScript chart as an array
  • Before writing an importer, you want to see what column names and values another system’s export really contains

Line breaks and quotes inside a cell

Under RFC 4180, a field that holds a line break, a double quote or a comma is wrapped in double quotes, and a quote inside it is written twice. One consequence is that lines of text and rows of data are not the same thing.

  1. 1The header is title,body, and the next row is "Hello","line one<line break>line two", with the break inside the quotes.
  2. 2The result’s body is the single string "line one\nline two": three lines of text, one record.
  3. 3"He said ""no""" reads as He said "no", which JSON writes as "He said \"no\"".
  4. 4A quote that opens and never closes stops the conversion, and the message names the line and column where it started.

Type conversion is decided cell by cell

With number and true/false conversion on, a value becomes a number only when it is a plain integer or decimal. Trying it out: 1.50 becomes 1.5, while 1e5, +5 and .5 stay strings; TRUE becomes true whatever its case; -0 comes out as 0. " 7" with a leading space stays a string, since RFC 4180 counts spaces as part of the field. An integer too large to hold exactly, such as 12345678901234567890, also stays a string.

The decision is per cell, not per column. A price column holding 1,50 in one row and 12 in the next gives "1,50" and 12, a string and a number side by side. Where trailing zeros matter, as in prices or version numbers like 1.10, leave conversion off and convert only the columns you need in your own code.

The first line picks the separator

The separator is chosen by counting commas, tabs, semicolons and vertical bars outside quotes on the first line and taking the most frequent. A first line of a,b;c;d is therefore read with semicolons even if every data row uses commas, and a first line of "a;b;c",d is read with commas because the semicolons are inside quotes.

Cells copied from Excel or Google Sheets arrive as tab-separated text, so a pasted block of names and scores is read as tab-separated with no setting to change. In a European semicolon file, a decimal comma such as 1,50 is not turned into a number; it stays text. Pipe-separated files (a|b), common in log exports, are detected the same way.

CSV files saved by Korean Excel

Excel on Korean Windows saves “CSV (Comma delimited)” in the CP949 code page, an extension of EUC-KR, not in UTF-8; “CSV UTF-8” is a separate choice in the Save as list. When you open a file with the text-file button, the tool first tries strict UTF-8, falls back to EUC-KR if that fails, and drops a UTF-8 byte order mark. If the decoded text contains the replacement character (�), a button offers to reopen it in another encoding.

Files must be 1 MB or less and have a text extension such as .csv or .txt. For a bigger export, copying just the rows you need from the sheet and pasting them is quicker, and pasted text has no encoding to get wrong because the browser has already decoded it.

Checked

Frequently asked questions

Can numbers come out as numbers instead of strings?

Yes. Choose Convert numbers and true/false; 3 becomes the number 3 and true or false become booleans. By default every value stays a string, such as "3".

Why does a code like 00123 stay a string?

Turning it into a number would drop the leading zeros, so it stays "00123" even with conversion on. Numbers with thousands separators such as 1,000, and dates, also stay strings.

Does it read tab- or semicolon-separated files?

Yes. It counts commas, tabs and semicolons outside quotes in the first line and uses the most frequent one. If the first line is not a header, set it to Data and keys such as 열1, 열2 are used. Up to 10,000 rows and 200 columns.