CSV Viewer & Editor
View, edit, sort, and export CSV data in a table format
Paste CSV data or upload a file to get started
CSV Viewer opens a comma-, semicolon-, or tab-separated file in an editable grid without involving a spreadsheet application. Paste text or drop a file, confirm how the delimiters and quotes were interpreted, fix values in place, sort a column, then export back to CSV or convert to JSON. Parsing, editing, and downloading all happen locally, which makes the tool suitable for datasets that should not be uploaded.
Loading and Parsing a File
You can paste raw text into the input area or switch to the upload tab and choose a file, or drag one onto the drop zone. Accepted extensions are .csv, .txt, and .tsv, and the selected file is read entirely in the browser. Before parsing you choose a delimiter from auto, comma, semicolon, or tab, and whether the first row is a header (on by default). Pressing Parse builds the table; the header row becomes column titles and serves as the JSON keys. If parsing succeeds, a toolbar appears with add and delete controls for rows and columns.
Delimiter and Quote Rules
Auto-detection samples the first ten non-empty lines and counts candidate separators that occur outside quoted regions. Commas, semicolons, and tabs are scored, and the highest score wins; ties fall back to comma, and an empty input also defaults to comma. The parser then applies RFC 4180 quoting: double quotes wrap any field that contains the delimiter, a newline, or a quote; two consecutive quotes inside a quoted field decode to a single quote; and a newline inside quotes does not end the row. This is why a single logical record can occupy several physical lines and still parse as one row with the quoted text intact.
Worked Example: A Quoted CSV
Consider this three-line file:
name,note,zip
"Doe, Jane","He said ""hi""",01234
Parsing with comma and the header checkbox enabled produces headers of name, note, and zip, and one data row whose cells are Doe, Jane, He said "hi", and 01234. The embedded comma did not create an extra column, and the doubled quotes collapsed to one.
Exporting that row back to CSV quotes only the fields that need it, producing "Doe, Jane","He said ""hi""",01234. Exporting to JSON instead yields one object, roughly [{"name":"Doe, Jane","note":"He said \"hi\"","zip":"01234"}], where the literal quote is escaped for JSON. Notice that 01234 remains a string in both outputs, preserving the leading zero that a spreadsheet might strip.
Editing, Sorting, and Exporting
Click any cell to replace its value with an inline text input. Enter or clicking away saves, and Escape cancels the edit. The toolbar adds a blank row at the bottom, appends a new column titled Col N, removes the last row, or removes the last column, refusing to drop below one column. Column headers are sort buttons that cycle ascending, descending, and unsorted. Sorting uses numeric order only when the entire column is numeric; otherwise it uses locale-aware string order. CSV export uses the active delimiter and re-escapes fields, while JSON export maps each row to an object keyed by the headers, filling missing cells with empty strings. The two downloads are named data.csv and data.json.
Edge Cases and Export Choices
If the whole file lands in one column, the delimiter guess was wrong; choose semicolon or tab manually. European exports often use semicolons because the comma is a decimal mark. Leading zeros, long digit strings, and values starting with =, +, -, or @ are all hazardous once opened in Excel: the first two can be reformatted, and the last are formula-injection vectors that this viewer deliberately does not sanitize. A column that mixes numbers with text or blanks sorts lexically, so 100 precedes 20. Finally, an unbalanced quote can swallow following lines into one cell, which is usually a sign the source file is malformed rather than misdetected.
The right export depends on the consumer. Choose CSV when the destination is a spreadsheet, a database import, or another CSV tool, because it preserves the tabular shape and stays readable in a plain text editor. Choose JSON when the destination is code β an API request body, a config file, or a front-end prototype β since the header row becomes property names and each record is self-describing. One caveat about JSON export: because the headers supply the keys, duplicate header names collapse into a single property and the last value usually wins. An empty header becomes an empty-string key. Make headers unique and non-empty before converting. Also remember that CSV has no standard way to express nested data, so any JSON structure containing arrays or sub-objects cannot survive a flat CSV round trip.
Limits of the Viewer
Everything is held in memory and rendered as DOM nodes, so there is no fixed row limit but also no streaming: extremely wide or tall files will slow the interface. All cells are strings, so there is no type inference, date parsing, or computed column. There is a single table with no multiple sheets, no undo history, and no autosave β a page refresh loses edits. The tool is built for inspection, light cleanup, and format conversion, not for heavy analysis; when a task needs formulas, charts, or pivot tables, move the cleaned export into a real spreadsheet.
Related Tools
Frequently Asked Questions
How does the tool decide which delimiter to use?
Auto-detect samples the first ten non-empty lines and counts commas, semicolons, and tabs that appear outside quoted fields. The delimiter with the highest count wins. Because comma is checked first and the comparison is strictly greater-than, a tie resolves to comma, and an empty file also defaults to comma.
How are quotes and commas inside values handled?
The parser follows RFC 4180 conventions. A field wrapped in double quotes may contain the delimiter, and a doubled pair of quotes inside that field represents one literal quote. A newline inside quotes is kept as part of the same cell rather than starting a new row. So "Doe, Jane" stays one field, and "He said ""hi""" becomes He said "hi".
Why did a number column sort as text?
Numeric sorting is used only when every non-blank value in the column parses as a number. A single entry like N/A, a leading zero, or a blank cell switches the whole column to locale-aware text order, where 100 comes before 20. Clean the column or convert the values if you need true numeric ordering.
Does export keep my edits and the original delimiter?
Yes. CSV export re-escapes each field β quoting only when it contains the delimiter, a newline, or a quote β and joins with the delimiter currently in use, so a semicolon file stays semicolon-separated. JSON export builds one object per row using the header row as keys. Both include every in-place edit made in the table.
What happens when rows have different numbers of columns?
The first parsed row sets the column count for the whole table. Cells in shorter rows render empty, and extra cells in a longer row are not shown or editable. Export writes the data structure as it stands, so values hidden past the column count are not guaranteed to survive a round trip through the viewer.
Is there a file size or row limit?
There is no enforced cap. The file is read with a client-side file reader and the whole table is rendered in the DOM, so practical limits depend on your device and browser. Very large files can slow parsing, sorting, and scrolling, and refreshing the page discards all edits because nothing is persisted.
Reviewed by the HandyTools Hub team Β· Last updated