Skip to content

Open a CSV in your browser, sort it and clean it up

Drop a CSV onto the panel above and it appears as a table you can sort by any column, filter to the rows you care about, deduplicate on whichever columns actually identify a record, and split a column that has two things crammed into it. Then save the result back out as a CSV. The file is read a megabyte at a time by this tab, so its size is not really the question, and the delimiter is worked out from the shape of the table rather than assumed.

In your browser

Open a CSV, tidy it up, and save it again

Open a spreadsheet export and look at it: sort a column, filter to the rows you want, take out the repeats and split a column that has two things in it. The file is read here, a megabyte at a time, and it is never uploaded, which matters more for this kind of file than for most.

or drag one onto this box. It is read a megabyte at a time, so the size of the file is not the limit.

Your spreadsheet is not uploaded. It is read straight off the disk by this page, a megabyte at a time in a background task beside it, and there is no code here that could send it anywhere. Saving writes a new file out of what is on screen and leaves the one you opened exactly as it was.

CSV viewer, step by step

  1. Drop the file onOr choose it, or paste a few rows in. Nothing is sent anywhere; the file is read straight off your disk.
  2. Sort, filter, and pick the columns that identify a rowTick match on above the columns that make a record unique, which is usually an email or an account number rather than the whole row.
  3. Take out the repeats, or split a columnThen save the table back out. The file you opened is untouched and a new one is written.
What it actually does

Why so many CSV tools open your file as one long column

CSV is not one format. It is a family, and the members differ in ways that break anything written with a split on the comma. A field can be wrapped in quotes and contain commas, or line breaks, or quote marks written twice over to mean one. Lines can end with a line feed, or a carriage return and a line feed, or on an old enough export a carriage return alone. Excel puts a byte order mark on the front of every file it saves as CSV UTF-8, which welds an invisible character onto the first column name and quietly stops anything looking that column up. And in every locale where the comma is the decimal separator, which is most of Europe, Excel writes semicolons instead. The reader here is a small state machine that handles all of that, fed a slice at a time so a boundary landing in the middle of a quoted field or between the two halves of a line ending is nothing. The separator is chosen by parsing the front of the file with each candidate and asking which one gives the most rows of the same width, rather than by counting characters, because counting picks the comma out of a tab separated file whose one prose column is full of them.

Spreadsheets are where the awkward files live. A CSV is the format everything can export and nothing can quite agree on, and the moment one gets big enough that opening it in Excel is a five minute affair, people start looking for something on the web that will just show it to them.

That is a reasonable thing to want and a bad thing to do with a customer list. The files that prompt the search are the ones full of names, addresses, order histories and salaries, and the sites that answer it are mostly a form that posts the whole thing to a server somewhere. This one does the same job with the file staying where it is.

The other half of the argument is duller and matters just as much. Most tools of this kind read one dialect of CSV correctly and mangle the rest, so a file that came out of a German Excel install, or one with an address column containing commas, or one where somebody’s note ran onto a second line, opens as nonsense. The reader here was written against those cases specifically, and there is a test for each of them.

Questions

Why does my file open as one long column somewhere else?

Almost always because it uses semicolons and the tool assumed commas. That is what Excel writes in any locale where the comma is the decimal separator, so a colleague in Berlin sending you an export is the usual way it happens. The delimiter here is worked out by trying each one and seeing which gives a table with a consistent number of columns, and the panel says which it picked so you can overrule it.

Is my spreadsheet uploaded anywhere?

No. The file is read straight off your disk by this page, in a background task beside it, and there is no code here that could send it somewhere. That matters more for this kind of file than for most, because the CSVs people convert are customer lists, payroll exports and transaction histories, and those get dragged onto whichever site is top of the results without anybody thinking about what it is they have just handed over.

How big a file can it open?

The file itself is read in pieces, so its size is not the limit and a few hundred megabytes is fine. What is limited is the number of rows kept in memory, because a table has to be there in full to be sorted and deduplicated. If a file is longer than that the panel says so plainly rather than silently showing you part of it, and everything on screen is still real and still in order.

What does it mean when it says rows are the wrong length?

It means some rows have more or fewer fields than the header does, which usually points at an unescaped quote mark or a comma somewhere it should not be. They are shown exactly as they were read rather than padded out with blanks or dropped, because both of those hand you back a file that is quietly not the one you had, and the second one loses data without telling you.