How to use it
- Choose a CSV or TSV file, drop it on the box, or paste the text; the result appears at once.
- Check the delimiter and the header option; the notes next to the result show what was detected.
- Decide whether numbers and true/false should become JSON numbers and booleans, and whether dotted headers should become nested objects.
- Download the .json file or copy the result.
Rules and limits
How CSV is read
- Delimiter: comma, semicolon, tab or vertical bar, detected from the first rows, or set by you.
- Fields in double quotes may contain the delimiter, line breaks and quotes written as two quotes (
""), as in RFC 4180. Line endings CRLF, LF and CR all work. Completely empty lines are skipped. - Encoding: UTF-8 with or without a byte order mark, and UTF-16 with a byte order mark. A file that is not valid UTF-8 is read as Windows-1251 when its letters look Cyrillic, otherwise as Windows-1252, and the result names the encoding. Files that are not text (a workbook, a Word document, a PDF, a picture, a gzip file or other binary data) are refused with a message that says what they are.
- Numbers, in CSV to JSON and CSV to Excel: with the decimal separator on “Automatic”, a comma is used when the delimiter is a semicolon (the usual European CSV), otherwise a dot. With a decimal comma, spaces between groups of three digits are read as thousands separators (
1 299,50). A dot or comma as thousands separator is not recognised, because1.234can mean 1234 or 1.234: such values stay text unless their dot or comma is the decimal separator. Values with leading zeros (01067), a leading plus sign (phone numbers) or more than 15 digits stay text.
From CSV to JSON
- With “Convert numbers and true/false” on, numbers become JSON numbers and true and false become booleans; empty fields stay "". With it off, every value stays a string.
- With “First row is a header” on, each row becomes an object keyed by the header names; with it off, each row becomes an array.
Dotted headers back to nesting
- With “Nest dotted headers” on, a column
address.citybecomes{"address": {"city": …}}. - Numbered parts become arrays when they run 0, 1, 2 … without gaps:
tags.0andtags.1become"tags": ["a", "b"]. - This reverses the array rule of JSON to CSV and JSON to Excel. If a column
aand a columna.bboth exist,a.bkeeps its flat name.
Questions and answers
How is the delimiter detected?
It picks the one that gives the same number of fields, more than one, in most of the first rows. Set it yourself if the guess is wrong.
Why did 01067 or 1,234.50 stay a string?
Changing them could change the data: 01067 would lose its zero, and 1,234.50 could mean two different numbers. Fix such values in the file if they should be numbers.
What if a header has a dot but should stay flat?
Leave “Nest dotted headers” off: the header is then used as it is, dots included.
Why do some letters look wrong?
The file was saved in an encoding other than the one the page guessed. Save it as “CSV UTF-8” in Excel, or as UTF-8 in your editor, and convert again.
What if rows have more or fewer fields than the header?
Missing fields become "" and extra fields get keys named column_N. The first such row is reported with its line number.