CSV Editor

Edit CSV as text or as a table, reformat it, check it and convert it to JSON

Loading...

About CSV Editor

CSV is the format every system agrees to export and no two systems agree how to write. This editor opens a file, shows it as raw text and as a table at the same time, and lets you fix it in either view. It handles the awkward parts of the format properly, which is most of the reason a dedicated tool beats opening the file in a spreadsheet that will quietly reformat your data on the way in.

What it does

  • Edit CSV as text with syntax highlighting, or edit it as a table, side by side
  • Drag the line between the two views, and fill the window with either or both
  • Type into any cell, add and remove rows and columns, header included
  • Switch between comma, semicolon, tab and pipe delimiters, reparsing as you go
  • Guess the delimiter for you when you open a file
  • Say what is wrong with the file: rows of the wrong width, a quote never closed
  • Reformat with correct quoting and escaping so the file survives the next reader
  • Convert to JSON, one object per row keyed by the header
  • Open a file by dropping it on the page, and download the result
  • Copy the whole thing to the clipboard

Two views of one file

The text on the left and the table on the right are the same document, not a copy and a preview of it. Put the caret in a cell in the text and that cell lights up in the table. Type into the table and the text changes underneath you.

Editing a cell rewrites that cell and leaves the rest of the file exactly as it was, byte for byte. Quoting you did not ask to change does not change, rows you did not touch are not rewritten, and a file that came out of some other system goes back looking like it did. Reformatting the whole thing is what the Format button is for, and it happens because you asked rather than because you fixed a typo in row 12.

Click a cell to select it, double-click or press Enter to edit it, and use the arrow keys to move. Escape puts a cell back the way it was. Row 1 is the header and can be edited like any other.

The line between the two is a handle. Drag it and the text takes as much of the row as you give it, which is what a file of forty columns wants one way and a file being fixed by hand wants the other. Where you leave it is where it is the next time you come back. On a phone the two views stack instead, since a column half a screen wide is not a view of either.

The arrows at the end of the buttons fill the window with the whole tool, which is the answer to a file with more columns than a card in a page has room for. Everything comes with it, the view buttons and the delimiter included, and the divider stays where you put it. The bar across the top of the site stays where it is, so leaving is a click on the same button or the Escape key.

What it tells you about the file

The two things that actually go wrong with a CSV are a row that has more or fewer fields than the header, and a quote that is opened and never closed, which swallows the rest of the file into one value. Both are reported with the line they start on, above the editor.

Nothing is dropped because of either. A row wider than the header keeps its extra values: they get a column in the table, they survive Format, and they come out in the JSON under a positional name. A tool you opened to protect a file should not be the thing that shortens it.

Why the delimiter matters

Comma separated values are frequently not comma separated. In locales where the comma is the decimal separator, which covers most of Europe and Latin America, spreadsheet software exports semicolon separated files and still calls them .csv. A file that opens as one giant column somewhere else is almost always this, and switching the delimiter fixes it outright. Tab separated files turn up in exports from databases and analytics tools, and pipe separated ones in older enterprise systems where the data itself was full of commas.

Opening a file guesses which one it is rather than making you find out. The guess is made by reading the file four times, once per candidate, and keeping the one that produces the most columns while the rows still agree with each other about how many there are. That is a property a real delimiter has and a character that merely appears in the data does not. The buttons still override it.

Quoting, escaping and the rules underneath

The parser follows RFC 4180, the closest thing CSV has to a specification, and tokenizes the whole document rather than splitting it into lines first. That distinction is what makes the difference on real exports:

  • A quoted field may contain the delimiter, so "Smith, John" is one value rather than two.
  • A quoted field may contain a line break, so an address column with two lines in it stays a single row instead of tearing the file in half.
  • A doubled quote inside a quoted field means a literal quote character, so a field written as "She said ""yes""" is read the way it was meant.
  • Fields that arrived wrapped in quotes keep their surrounding whitespace, because the quotes are how the writer said that whitespace was deliberate.

Duplicate column names are made unique rather than left to collide: a second column called id becomes id_2. Rows are keyed by header, so without that the second column would overwrite the first and a column of data would vanish silently.

Opening a file

Use the Open File button or drop a file anywhere on the tool. Up to 2 MB, which is the same ceiling the command line uses. Everything here happens in the tab: the whole file is held in memory, every line of it is laid out on screen, and each change reparses it. Something big enough to make that painful wants a script rather than a text box, and saying so is kinder than a page that stops responding.

Converting to JSON

The JSON tab treats the first row as the header, and each row after it becomes an object keyed by those headers, which is the shape most APIs, scripts and test fixtures expect. The result can be copied or downloaded from the same buttons. Values come out as strings, matching exactly what the file contained. Nothing tries to guess that a column of digits was meant to be numeric, which is deliberate: that guess is what turns product codes into numbers and drops their leading zeros.

A field with no header above it still gets a key, named for its position, and a row too short to reach a column gets an empty string rather than a missing key. Both are there so that the objects have the same shape as each other and nothing in the file goes unnamed.

Privacy

Files are read locally through the browser file API, and every parse, edit, conversion and download happens on your machine. Nothing is uploaded. CSV exports are routinely full of customer records, invoices and payroll, so this is the point of the tool rather than a footnote to it.

Frequently Asked Questions

Which delimiters does the CSV editor support?

Comma, semicolon, tab and pipe. Semicolon matters more often than people expect: spreadsheet software in locales where the comma is the decimal separator, which covers much of Europe and Latin America, exports semicolon separated files by default even though the extension still says .csv. Opening a file guesses which delimiter it was written with, by keeping the one whose rows agree with each other about how many columns there are, and the buttons override the guess. Switching re-parses the data immediately.

Can I edit the data in the table, or only as text?

Either. Click a cell in the table to select it, double-click or press Enter to edit it, and use the arrow keys to move between cells. Rows and columns can be added and deleted, and the header row is editable like any other. Whatever you change in the table appears in the text immediately, and the other way round.

Does editing one cell reformat the rest of my file?

No. An edit rewrites that cell and leaves every other byte of the file exactly as it was, including quoting you did not ask to change. That matters when the file came out of another system and has to go back into it. Reformatting the whole document is what the Format button does, so it happens when you ask for it rather than as a side effect of fixing a typo.

What happens to a row with more columns than the header?

It is reported with its line number and then kept intact. The extra values get a column in the table, they survive Format, and they appear in the JSON under a name based on their position. A row that is too short is reported the same way, and the cells it does not have are shaded so you can tell an absent field from an empty one. Nothing is dropped for being the wrong shape.

How large a file can I open?

Up to 2 MB, the same ceiling the site command line uses. Everything runs in the browser tab: the file is held in memory, every line is laid out on screen, and each edit reparses it. Past that size the page would stop responding, which is worse than being told the file is too big.

Does it handle quoted fields containing commas or line breaks?

Yes. The parser follows RFC 4180 and tokenizes the whole document rather than splitting it line by line, so a quoted field may contain the delimiter, a doubled quote as an escape, or an embedded newline without breaking the row. This is the single most common reason naive CSV tools mangle exported data, particularly address and free-text columns.

What happens if two columns have the same header?

Rows are keyed by header name, so duplicates would overwrite each other. Repeated names are made unique instead: a second column called id becomes id_2. Nothing is silently dropped, and the table view shows both columns as they appeared in the file.

Can I convert CSV to JSON?

Yes, through the JSON tab. The first row is treated as the header and each subsequent row becomes an object keyed by those headers, which is the shape most APIs and scripts expect. The result can be copied or downloaded from the same buttons. Every value comes out as a string, matching what the file actually contained, so no guessing is done about which columns were meant to be numbers.

Is my spreadsheet data uploaded to a server?

No. Files you open are read locally through the browser file API and every parse, edit and export happens on your own machine. Nothing leaves the tab. Given that CSV exports routinely hold customer lists, invoices and payroll data, this is the point of the tool rather than a detail of it.