Clean a CSV file

Paste a table or open a CSV, TSV or Excel .xlsx file and get a tidy copy: spaces trimmed, invisible characters gone, blank and duplicate rows removed, header names fixed and every row the same length. Each change is counted and listed. Everything runs in your browser.

CSV Cleaner

or drop a file here. It stays on this device.

How it works

  1. Paste a table into the editor, or open a .csv, .tsv, .txt or .xlsx file. For an Excel workbook, choose the worksheet to import.
  2. Tick the cleaning steps you want; the defaults trim cells, remove blank and duplicate rows, fix header names and even out row lengths.
  3. Press Clean the table, read what changed, then copy the result or download the cleaned file.

Questions

What counts as a duplicate row?

A row whose cells are all identical to an earlier row after cleaning (so "Ada " and "Ada" match once trimming is on). The first occurrence is kept. Tick the letter-case option to also treat "ada@x.io" and "Ada@X.io" as the same. Rows are compared as text: 1 and 1.0 are different. Blank rows never count as duplicates; Remove blank rows decides about them.

What happens to header names?

With the header option on, names are trimmed; an empty name becomes column_N and a repeated name gets _2, _3 and so on, so every column can be told apart. The snake_case option rewrites "First Name" as first_name (lower case, accents dropped, anything that is not a letter or digit becomes one underscore). Untick Fix header names to keep the header row exactly as typed: it is then not trimmed or cleaned, and snake_case is off.

Which invisible characters are removed?

Zero-width spaces and joiners, stray byte order marks and control characters (other than tab and line breaks) are deleted; non-breaking spaces become ordinary spaces. Accented letters, emoji and other visible text are left alone.

What counts as a blank row?

An empty line, or a row whose cells are all empty after cleaning, such as ,, or "". Remove blank rows deletes them, including empty lines above the header. Untick it to keep every blank row where it is; an empty line stays an empty line.

How are uneven rows handled?

With the option on, rows with fewer cells than the header are padded with empty cells, and rows with more cells keep them in new columns named column_N (column_N_2 when a header already has that name), so no data is lost. The changes list says how many rows were affected.

Does it change my values, dates or numbers?

No. Cells are only trimmed and stripped of invisible characters; "007", "1,5" and "12/03/2024" stay exactly as typed. Quoted fields with commas, quotes or line breaks stay quoted in the output, following the CSV standard (RFC 4180). A quote that never closes is reported with its line number and the editor jumps to it; so is a closing quote followed by other text before the next delimiter, such as "12.50"x, with its line and column, instead of being joined to the cell.

Which encodings and delimiters are supported?

Text is read as UTF-8, with or without a byte order mark; the cleaned file starts with one, the mark Excel needs to read accented and Chinese letters in a CSV file (as Reconcile Sheets' and Quote's files do), unless you choose Only when the input had one, or None, for a program that does not expect one; a file saved in another encoding may show odd characters, so save it as UTF-8 first (Excel: File, Save As, CSV UTF-8). Comma, semicolon, tab and pipe are detected from the first lines, or you pick one; the output can keep the same delimiter or switch to comma, semicolon or tab, with LF or CRLF line endings. Same as the input keeps the line endings of the opened file, or of text pasted into the empty editor.

Can I open an Excel workbook?

Yes: choose an .xlsx file and select its worksheet if it has more than one. The table is filled with saved cell values; number cells are read as Excel shows them, to 15 significant digits, so a stored -85.40000000000001 is -85.4, and text cells exactly as typed. Formula results are read from the last saved calculation; formulas are never executed. Common date formats become ISO dates and simple zero-padded identifiers keep their zeros. Charts, macros and formatting are not imported. A formula without a saved result or a cell containing a spreadsheet error is reported before import. Old .xls, encrypted files and .xlsm are not accepted; save as .xlsx or CSV first.

Is my text uploaded?

No. The page loads a small script into your browser and every operation runs on your device. You can check this yourself in the browser's network panel: after the page has loaded there are no upload requests. Closing the tab discards the text.

Do I need an account or to pay?

No. These basic tools are free and add nothing to your data. The only limits are the tool's own: files up to 32 MB; XLSX up to 1,000 columns, 200,000 rows and 1,000,000 stored cells, within 2,000,000 table positions. Within them, the practical limit is your device's memory.

What does this page keep in my browser?

Nothing you open or type. While the tab is open, the tool pages keep a short list of the steps taken in it, in the tab's session storage: the step (page opened, started, succeeded, first success, used again or failed), the tool's name, the time, how many files were used and, for a failure, an error code; never a file name, the contents of a file or your text. It holds at most the latest 200 steps, and the browser deletes it when the tab closes. The page never sends it. Where a Report a problem button is shown, you can attach the last 20 steps to your report; nothing is attached unless you tick that box. In local storage the page keeps only choices you made: a Light or Dark theme until you choose System again, the language you picked with the EN / 中文 switch if it differs from your browser's language, and this tool in your recently used list if you switched that list on at the tools page.

Questions or problems

Found a problem or missing feature? Tell us. Please describe the steps; do not send confidential data.