Last checked by the TextEditor.com team
How to use the CSV editor
Drop a CSV file on the page, or click the box and pick one. You can also paste CSV text, or start with an empty table. The grid works like a small spreadsheet: click a cell and type, press Enter to change what is in it, Tab moves right. Your table saves in this browser as you work. Nothing is sent to our server.
- OpenDrop the file, paste the text, or copy cells in Excel and press Ctrl+V in the grid.
- FixSort, find and replace, remove duplicate rows, trim spaces. Click a column letter to see its count, sum and range.
- ExportPick CSV, TSV, JSON, Excel, Markdown, HTML or SQL. Copy the result or download a file.
Only the rows on the screen are drawn. A file with 50,000 rows and 20 columns opens in about a second and scrolls like a small one.
What a CSV file is
CSV stands for Comma Separated Values. The file is plain text. Each line is one row, and commas split the cells. The first line usually holds the column names. You can open a CSV file in Notepad and read it. That is why nearly every program that works with data can read and write it.
name,city,joined Anna Smith,Oslo,2024-01-05 "Lee, Sam",Austin,2023-11-30
| name | city | joined |
|---|---|---|
| Anna Smith | Oslo | 2024-01-05 |
| Lee, Sam | Austin | 2023-11-30 |
There is no real standard. RFC 4180 from 2005 wrote down the common rules, but it is an informational memo, not a rule that programs must follow. The biggest difference between programs is the separator. Excel uses the list separator of your Windows region. Where the decimal sign is a comma, as in Germany, France or Hungary, that separator is a semicolon. A file saved in Berlin can open in one column in New York.
The quoting rules
A cell can hold a comma, a quote or even a line break. Then the whole cell goes inside double quotes. A quote inside such a cell is written twice. Spaces at the start or end of a cell are kept only inside quotes, so quotes help there too. Type any value below and see how this editor writes it.
With commas: "She said ""hi"", then left" With semicolons: "She said ""hi"", then left" With tabs: "She said ""hi"", then left"
The value has a quote, so it goes in quotes and each quote inside is written twice. The comma would split the cell in the comma version, so quotes are needed there anyway.
When a program skips one of these rules, the file breaks. A quote without its pair pulls every row after it into one giant cell. If a file looks wrong after opening, look at the first row that went wrong.
Why Excel breaks CSV files
Excel does not open a CSV file as text. It guesses what each cell is and changes it. When you press Save, the changed values go back into the file. These are the common cases:
| What the file has | What Excel shows | How to keep it |
|---|---|---|
| 00420, a postal code or a phone number | 420 | Open through Data, From Text, and set the column to Text |
| MARCH1, SEPT2, 1-2 (gene names, sizes) | 1 March, 2 September, 2 January | Same. In 2020 the human gene naming committee renamed 27 genes because of this. |
| 4111111111111111, a card or account number | 4.11111E+15, and the digits after the 15th turn into zeros | Text column. Excel keeps 15 digits of a number. |
| 2024-01-05 | 1/5/2024 or 05.01.2024, in your region's format | Text column, or accept the new format |
| é, ő, 日本 in a UTF-8 file | é, Å‘ or question marks | Save the file with a byte order mark (BOM). Excel then reads it as UTF-8. |
The byte order mark is three hidden bytes at the start of the file. Excel sees them and reads the file as UTF-8. Most other programs ignore them, but some scripts choke on them and show a strange first column name. The Export panel has a switch for it. Turn it on for Excel, off for everything else.
CSV, TSV or JSON?
| Format | Cells split by | Good for | Watch out |
|---|---|---|---|
| CSV | Comma or semicolon | Excel, databases, nearly every program | Quoting, the regional separator, text encoding |
| TSV | Tab | Pasting into a spreadsheet. Cells rarely hold tabs. | Many programs do not quote at all, so a line break inside a cell breaks the row |
| JSON | Keys and values, no rows | Web apps, scripts, settings files | Bigger file. Numbers and text are different types, so 00420 must be a string. |
Copy from the grid gives tab separated text, and Excel and Google Sheets paste it as cells. The JSON export gives an array of objects with the header names as keys, ready for a script or for the JSON editor.
How to open a CSV file without Excel
Any text editor opens a CSV file, but a grid is easier to read. Drop the file here. The separator and the text encoding are found by themselves, and you can change both in the bar above the grid. The Wikipedia page on CSV lists more programs and the history of the format.
Need Excel or OpenDocument files, or a workbook with several sheets? Use the table editor. Need a table for GitHub or a README file? Export as Markdown here, or build it in the Markdown table generator.
Keyboard shortcuts
| Keys | What they do |
|---|---|
| Arrow keys, Tab | Move to the next cell. Hold Shift to select more cells. |
| Type, Enter or F2 | Typing replaces the cell. Enter and F2 change what is in it. |
| Alt + Enter | A line break inside a cell |
| Delete | Clear the selected cells |
| Ctrl + C, V | Copy and paste cells, also to and from Excel and Google Sheets |
| Ctrl + Z, Y | Undo and redo |
| Ctrl + F | Find and replace |
| Ctrl + K | Every tool in one list. Type to find one. |
| Ctrl + S, O | Save the file, or open one |
On a Mac, use Cmd in place of Ctrl. On a phone, tap a cell and change it in the box above the grid.
Other tools for tables and lists
- Edit a spreadsheet
.xlsx▦The table editor opens Excel files and cells you paste. - Make a Markdown table
| a | b |Fill in a grid and copy the table as text. - Check and format JSON
{"a":1}The JSON editor explains each error and the line to fix. - Remove repeated linesa a b → a bKeeps the first copy of each line and drops the rest.