Data Tools

How to Read a CSV File Correctly: Delimiters, Quotes, Encoding and Sorting

By Smart Tools Utility Team · Published October 7, 2026 · Updated October 7, 2026 · 9 min read

A CSV file looks simple: values separated by commas. In practice, "CSV" covers files separated by semicolons or tabs, values wrapped in quotes, line breaks inside cells and several text encodings, and the same file can look right in one program and wrong in another. A viewer is the quickest way to find out what a file really contains. This guide shows how to use our CSV Viewer, explains the rules that decide whether a file reads correctly, and documents the cases where the viewer and your data disagree, which we found by testing files that were deliberately awkward.

What a CSV file is, and the rules that matter

CSV (comma-separated values) is plain text. Each line is a row. Within a row, a delimiter character separates the fields. There is no single enforced standard; the closest is RFC 4180, which describes the common conventions, and many files deviate from it. The rules that matter for reading a file correctly are these:

How to view a CSV file, step by step

  1. Add the data. Click Choose File under Upload a CSV file, or paste into ...or paste CSV data. Choosing a file only loads its text into the box; the table does not appear until the next step.
  2. Check the settings. Delimiter offers Auto-detect, Comma (,), Semicolon (;) and Tab. First row is header is ticked by default; untick it if your file has no header.
  3. Click View as Table. The line above the table shows the row and column counts.
  4. Sort and filter. Click a column header to sort by it (click again to reverse). Type in Filter rows... to keep only the rows where any cell contains your text, ignoring case.
  5. Click Download CSV if you want the displayed rows back as a file named csv-viewer-export.csv.
The CSV Viewer with a sales CSV pasted in and a table of four rows and six columns sorted by units in descending order
Four orders shown as a table, sorted by the units column in descending order. Quoted values containing commas and quotes were read correctly.

The data in the screenshot has a quoted comma ("Nguyen, Linh"), a doubled quote inside a quoted field ("Gift wrap; ""rush"" order"), an empty field and a thousands separator inside a quoted number ("1,980.00"). All were read as intended: Nguyen, Linh stayed in one cell and the notes cell shows Gift wrap; "rush" order. A line break inside quotes also works: a cell written as "line one newline line two" stays one cell with two lines.

Delimiters and auto-detect

With Auto-detect, the viewer counts commas, semicolons and tabs in the first line only and uses the one that occurs most. When counts tie, the comma wins. That works for ordinary files: a semicolon file with name;price;qty in its first line is detected, and Apfel;1,25;10 is split into three cells, keeping the decimal comma intact.

It can go wrong in two ways. First, it counts delimiters inside quotes too. A header such as "Last, First, Middle";Age has two commas and one semicolon, so the viewer picks the comma and shows a single column. The fix is to choose the delimiter yourself in the dropdown. Second, only three delimiters exist in the list. A pipe-separated file (a|b|c) shows as one column with no way to split it. Replace the pipes with commas or tabs in a text editor and view it again. Forcing the wrong delimiter also gives odd results: a semicolon file forced to Comma splits Apfel;1,25;10 into Apfel;1 and 25;10, with the extra column labelled Column 2.

Quotes: the one that corrupts a row

Quote handling follows the rules above, but with one strictness issue that affects real files. A double quote anywhere in a field starts "quoted mode", not only at the very start. That matters for data such as measurements in inches. This file is perfectly sensible to a human:

part,size,qty
pipe,5" long,3
nut,M8,10
bolt,M6,20
The CSV Viewer showing the three-line parts CSV collapsed into a single table row where the size cell contains the text for all the remaining lines
The stray quote after the 5 swallowed the rest of the file: one row, with everything after it inside the size cell.

The viewer shows 1 row. The quote after the 5 opened a quoted section that never closes, so everything after it, including the line breaks and the other two items, ended up inside a single cell. There is no warning. The same thing happens with an unterminated quote like 1,"oops: the rest of the file becomes one cell. Whenever the row count is far lower than you expect, look for a stray quote. Strict CSV writers would have written "5"" long"; if you can, fix the source. Otherwise replace the stray quote in a text editor (for example with the word "inch") before viewing.

Want to look at your CSV as a table?

Open the CSV Viewer

Encoding: when accents turn into question marks

Uploaded files are read as text by the browser, which expects UTF-8 and also recognises a byte order mark. We loaded four versions of the same two-row file with the names José, Zürich, Müller and Köln:

The last case is the common one. The bytes for é in Windows-1252 are not valid UTF-8, so the original information is already gone once the file is loaded here. Re-save the file as UTF-8 and try again: in Excel, use Save As and choose CSV UTF-8; in a text editor, look for the encoding option when saving. Pasting text instead of uploading avoids the problem, because the characters have already been decoded by the program you copied from.

Uneven rows, blank lines and the header

Sorting: what to trust and what not

Clicking a header sorts that column. If both values being compared start with a number, they are compared as numbers; otherwise they are compared as text with natural ordering (so item2 sorts before item10) and case ignored. The number test reads as many leading digits as it can, and that has consequences. We sorted this data:

product,units,revenue,date
Widget,9,"1,200.50",2026-03-01
Gadget,10,950,2026-01-15
Gizmo,100,"2,000",2026-02-20
Thing,2,n/a,2026-03-09
Alpha,10,-5.5,2025-12-31

So sort only on plain numeric columns, and treat date and formatted-number sorting as unreliable until you have verified it. To order dates properly, convert them in the source to a format where plain text order is correct and each value is compared whole, or sort in a spreadsheet.

Filtering and exporting

The filter matches your text anywhere in any cell, case-insensitively, and it matches across the original text of the cell: filtering for 1,2 found the row containing 1,200.50. The row count updates to the number of rows displayed.

Download CSV exports what is on screen: the current filter and sort order apply, and the header row is included. We found some details worth knowing:

How large a file can it handle?

The tool builds the whole table on the page, so speed depends on row count and your computer. In our test browser, 10,000 rows (about 360 KB) took about 2 seconds to display, and sorting that table took about 3.5 seconds; 50,000 rows (about 2 MB) took about 27 seconds to display and sorting took about 17. The code itself has no limit, but for files beyond a few tens of thousands of rows, a spreadsheet or a command-line tool is the better choice.

Is it safe to open a private CSV here?

We loaded files and pasted data while watching the network, and there were no requests after the page had loaded: files are read locally and the table is built in your browser. The page loads styling from a public CDN when it opens and may show third-party advertising; our code does not send your data to either. For files with customer details, financial records or other sensitive data, the safest habit is to remove what you do not need first, or to use a tool on your own machine.

Quick answers

Why do I see one giant column? The delimiter was not detected or is not one of the three supported. Pick it in the dropdown, or convert pipes and other separators first.

Why does my file show fewer rows than expected? Check for a stray double quote, which merges rows into one cell, and for blank lines, which are skipped.

Can I edit cells? No. The viewer is read-only; you can sort, filter and export.

Can I turn the data into JSON or Excel? The JSON to Excel / CSV Converter goes from JSON to a table and CSV or XLSX. To see what changed between two exports, use Text Compare.

Want to look at your CSV as a table?

Open the CSV Viewer