CSV Cleaner

Open a CSV, TSV or Excel file to trim stray spaces, drop empty rows and columns, and give the headers clean, unique names. Then download the tidy CSV.

How it works

The file is read in a background worker on this device. Every cell stays text, so a code such as 01234 keeps its leading zero.

Each option you tick is applied to a copy of the table: spaces trimmed from the ends of each cell, runs of spaces and tabs inside a cell made into one space, and rows or columns with no values at all removed.

Headers are renamed in the style you pick. Repeated names get a number, such as name_2, so code that reads columns by name loses none of them.

How to use it

  1. 1 Choose a CSV, TSV or Excel file, drop it on the box, or paste it. Try sample data has stray spaces, an empty row and an empty column.
  2. 2 Keep or untick the cleaning options. The counts and the preview update as you change them.
  3. 3 Pick a style for the header names if the file is going into code or a database.
  4. 4 Check the list of renamed headers and dropped columns, then download the clean CSV.

Good to know

  • snake_case headers such as order_id work as column names in SQL, pandas and most import tools without quoting.
  • A column is dropped only when every cell in it is blank. One value anywhere keeps it.
  • The cleaner changes spaces and structure, not the words in your cells. Text keeps its case.
  • To remove repeated rows as well, run the result through the Duplicate Row Finder.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Cleaning a CSV: the invisible problems that break an import

Most problems in a CSV file cannot be seen in a spreadsheet. A space after a name looks like nothing, but it makes "Ravi Kumar " a different value from "Ravi Kumar", so a lookup fails and a count shows two customers. A row of empty cells at the end of an export becomes a record with no values. A column with a blank header or a header with a line break in it stops an import tool or produces a column named Unnamed: 7. This tool fixes those problems of shape and spacing, and leaves your values alone.

Cell cleaning has two parts. Trim removes spaces and tabs at the start and end of every cell, which is where stray spaces almost always are. Collapse turns a run of two or more spaces or tabs inside a cell into one space, which fixes names and addresses that were typed or pasted with double spaces. Neither option converts values. A cell holding 01234 is still 01234 afterwards, and a date is still written the way it was, because the cleaner keeps every cell as text.

Structure cleaning removes rows and columns that hold nothing. A row is dropped only when every one of its cells is blank, and a column only when every cell in it is blank. A single value anywhere keeps the row or column. The counts above the preview say how many of each were removed, and the dropped columns are listed by name, so nothing disappears without you seeing it.

Header cleaning matters most when the file goes into code or a database. Pick snake_case and "Order ID", "E-mail Address " and "orderId" become order_id, e_mail_address and order_id. Repeated names get a number, so the second order_id becomes order_id_2 and no column is silently overwritten when the table is read by name. camelCase, Title Case and lower case work the same way, and Keep only tidies the spaces. Every header that changed is listed with its old and new name.

The cleaning runs in a background worker on this device, so files up to 200 MB are handled without being uploaded. The preview shows the first 100 rows of the result and the download has every row. Changing an option re-runs the cleaning from the file you opened, so you can try a setting and turn it off again. The cleaner does not remove duplicate rows or fill blanks. Use the Duplicate Row Finder and the Missing Value Analyzer for those.

Frequently asked questions

Will cleaning change my numbers or dates?

No. Values are only trimmed and their inner spaces collapsed. Nothing is converted, so 01234 stays 01234 and 05/01/2024 stays as written.

What does it do with two columns that have the same name?

It keeps both and adds a number to the second, such as Name 2 or name_2. Many tools keep only one of two columns with the same name, and the other is lost.

Does it change the case of the values in my cells?

No. Case is changed only in the header names, and only when you pick a style other than Keep. Values keep the case they were typed in.

Is my file uploaded?

No. It is read, cleaned and saved in your browser.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.