Why does my CSV look wrong, and what will the JSON contain?
Short answer: The CSV Viewer & Converter parses pasted text or a chosen .csv file with a comma, semicolon or tab delimiter (or auto-detect), honors double-quoted fields, shows the first 200 data rows as a table, and converts every parsed row to a JSON array of objects. Input is capped at 10,000,000 characters, 100,000 rows and about 500 columns.
Picture a spreadsheet export that opens as one long column of text, or a quoted address that splits in half. Both usually trace back to a wrong delimiter or a broken quote. This page lets you see how the file really parses before you feed it to code.
Key facts
- The Delimiter menu offers Auto detect (the default), Comma, Semicolon and Tab; other separators such as the pipe character are not available.
- Auto detect reads only the first line, counts commas, semicolons and tabs outside quotes, and picks the most frequent one; ties and lines with no delimiter fall back to comma.
- The option First row is a header is checked by default; when it is on, row 1 supplies the column names and is not counted as data.
- The Preview table button renders the first 200 data rows and adds a note with the real total when there are more.
- The Convert to JSON button outputs a 2-space-indented array with one object per data row, covering all rows, and every value is a string.
- The viewer rejects input over 10,000,000 characters (not bytes), over 100,000 rows including the header, or with more than about 500 columns in a row.
- The tool's script makes no network requests; pasted text and chosen files are read in your browser and are not uploaded.
How to use the CSV viewer
- Paste text into CSV data, or click Choose CSV file; a chosen file fills the text box and the status line confirms it.
- Leave Delimiter on Auto detect, and switch to Comma, Semicolon or Tab if the table comes out as one wide column.
- Keep First row is a header checked if row 1 holds names; uncheck it if row 1 is data.
- Click Preview table to inspect the cells, then Convert to JSON and Copy JSON. Changing any field clears the table and the JSON, so click again after a change.
How rows become JSON
Every record becomes an object whose keys come from the header row. Short rows are padded with empty strings, and nothing is converted to a number or date.
width = number of cells in the longest row
key[i] = trimmed header cell i, or "Column i" if empty (i starts at 1)
repeated keys get " (2)", " (3)" ...
object = { key[i]: row[i] or "" } for i = 1..width
There is no rounding because no value is parsed numerically. The only text change is trimming spaces around header names.
Worked example
Input with First row is a header on and Auto detect selected:
id,name,note
1,"Rivera, Jo","Asked for a callback
next Tuesday"
2,"Chen, Lee",Prefers email
| Source fragment | How it is read | JSON result |
|---|---|---|
| 1 | Plain field | "id": "1" (text, not a number) |
| "Rivera, Jo" | One field; the comma is data | "name": "Rivera, Jo" |
| "Asked for a callback + line break + next Tuesday" | One field; the line break is data | "note": "Asked for a callback\nnext Tuesday" |
| Prefers email | Unquoted field | "note": "Prefers email" |
The status line reports 2 data rows parsed, even though the text spans five lines.
Semicolons, tabs and the delimiter guess
Spreadsheets in many regional settings write semicolons because the comma is the decimal mark. A file with the header item;price and a row Tea;4,50 is detected as semicolon-delimited, and 4,50 stays one value.
Auto detect looks at line one only. If your header is a single word and the data rows carry the separators, the guess falls back to comma, so pick the delimiter yourself.
When the viewer rejects a file
The parser is strict about quotes and stops with an error instead of guessing.
- Unexpected quote in an unquoted CSV field: a quote appears after other characters, or after a space that follows the delimiter, as in 1, "x".
- Only a delimiter or line break may follow a closing quote: text trails a closed quoted field, as in "x"y.
- A quoted field is not closed: an opening quote never finds its partner before the end of the input.
- CSV is limited to 100,000 rows or 500 columns: the size limits above were exceeded.
To fix a quote error, wrap the whole field in quotes and double any quote inside it.
Headers, ragged rows and blank lines
With the header on, the header Name,Name,,Name and the row Ann,Bo,x,Cy,z produce the keys Name, Name (2), Column 3, Name (3) and Column 5. The row has more cells than the header, so the extra cell gets a positional name.
A byte-order mark at the start is stripped, and both LF and CRLF line endings work. Blank lines before the first row are skipped, but a blank line after it becomes a record of empty strings, so check the end of the file for stray blank lines. A single trailing newline is harmless.
What this tool does not do
- The viewer does not edit cells, sort, filter or save a corrected CSV.
- The converter does not detect numbers, dates or booleans and does not validate what the values mean.
- The file reader decodes files as UTF-8, so a file saved in another encoding may show garbled characters.
- The tool converts CSV to JSON only, not JSON to CSV, and does not export to Excel formats.
Frequently asked questions
How do I convert a CSV file to JSON?
Paste the text or choose a .csv file, pick the delimiter, and click Convert to JSON. The result is a JSON array with one object per data row, and Copy JSON puts it on your clipboard.
Why does my CSV show up as a single column?
The delimiter is probably wrong. Auto detect checks only the first line, so choose Semicolon or Tab manually if that line is unusual or the preview still looks merged.
Does the preview show every row, and what are the size limits?
No, the table shows only the first 200 data rows, while the JSON includes every parsed row. Input can be up to 10,000,000 characters, 100,000 rows including the header, and about 500 columns.
Can a quoted CSV field contain a comma or a line break?
Yes. Inside double quotes, the delimiter and line breaks stay part of the field, and two double quote characters in a row stand for one literal quote.
What does the error Unexpected quote in an unquoted CSV field mean?
A double quote appeared inside a field that did not begin with one, often because of a space before the opening quote or a stray inch mark. Wrap the whole field in quotes and double any quote inside it, or remove the stray character.
Are numbers and dates converted to real JSON types?
No. Every value in the JSON output is a string, so 4.50 stays the text 4.50 and an empty cell becomes an empty string.
What happens to duplicate or empty header names?
Empty names become Column N by position, and repeated names get a suffix such as Name (2) or Name (3) so no key is overwritten. Header names are also trimmed of surrounding spaces in the JSON.
Is my CSV file uploaded anywhere?
No. The tool's script reads pasted text and chosen files in your browser and makes no network requests with them.
Related tools
Last reviewed: