🧹 CSV Cleaner
Paste CSV or TSV and apply dedupe, sort, blank-row removal, cell trim, header normalization, column extraction, and line-ending unification in one shot. RFC 4180 quote support.
🔒 About Privacy
- ・All processing happens entirely in your browser
- ・Your CSV data is never sent to any server
- ・No logs, no history, no database
⚙️ Input Settings
🧹 Cleaning Options
1-based column numbers or header names, comma separated
Only the specified columns are kept
📈 Processing Summary
🔗 Related Tools
📖 Where people get stuck
Runs deduplication, blank-line removal, cell trimming, snake_case header normalization, column extraction, sorting and line-ending unification over the CSV or TSV you paste. It interprets RFC 4180 quoting correctly, including commas, newlines and doubled quotes inside a field. Everything runs in the browser and no data is transmitted. Because it works on text, however, it does not know what the values mean — it cannot tell whether 007 is a postal code or a number, or whether 2025/03/04 is the 4th of March or the 3rd of April. Cleaning that succeeds while the content quietly breaks almost always happens at that boundary.
| Case | What happens | What to do |
|---|---|---|
| Getting the delimiter or the quoting wrong | Auto-detection decides from how often each character appears near the top, so it misfires when a column contains a lot of commas in its text. Watch out in particular for exports from European locales: where the decimal separator is a comma, the field delimiter is a semicolon — read that as comma-separated and everything collapses into one column. The other awkward case is newlines inside quotes. RFC 4180 permits a line break inside a quoted field, so one line and one record are not the same thing. Checking your work by counting lines will never add up. And a backslash-escaping dialect (produced by some database exports) is not RFC 4180 at all, so it cannot be split correctly. | Do not leave it to auto-detection: choose the delimiter explicitly. Then verify by column count — if the header column count matches every row after cleaning, the split worked. A single row with a different column count almost always means an unclosed quote on that row, which is a bug on the side that produced the file. For a backslash dialect, convert it to RFC 4180 form with csvkit or a spreadsheet before pasting it here. And the very first thing to do is write down the row and column counts before and after — confirming that the record count has not changed is one check you should always do, even by eye. |
| Deduplication only sees byte-identical strings | Comparison is string equality, so rows that look identical to a human survive as separate rows: a row with trailing whitespace, a row mixing full-width and half-width characters, a row differing in case, 03-1234-5678 versus 0312345678, 2025-01-05 versus 2025/1/5. Conversely, trimming first turns rows that were distinct into duplicates — which means the order of operations changes the final row count. Equally important is which of the two survives: this tool keeps the first occurrence and discards later ones. Deduplicate data sorted by update time as-is and you keep the older row. |
Fix the order as normalize first, deduplicate second. On this page that means enabling trim and running deduplication in the same pass. If full-width and half-width characters or mixed case are involved, run the text through the width converter and the case converter first and bring it back here. To control which row survives, sort before deduplicating — order by update time descending and the newer row is the one kept. And use the deduplication key columns: matching on only the columns that are genuinely the key, such as email or id, rather than the whole row, stops noise in the other columns from defeating the comparison. |
| A clean CSV breaks the moment Excel opens it | The CSV you produce here may be correct, but letting Excel open it by double-click rewrites the content. Four things happen routinely. Leading zeros vanish (007 becomes 7, hitting postal codes, employee numbers and phone numbers). Values are read as dates (1-2 becomes a date; the gene name MARCH1 turning into a date pushed the research community to rename genes). Numbers longer than about sixteen digits get rounded, so card numbers and some IDs end in zeros. And UTF-8 without a BOM turns into mojibake — this tool does not add a BOM, so non-ASCII text is garbled in Excel on Windows. In every case, saving the file again makes the damage permanent. |
Do not open it by double-click. In Excel, use Data > From Text/CSV and set the problematic columns to Text before importing. That is the only reliable route. If you know the recipient will open it in Excel, export UTF-8 with a BOM — the easy way is to save the output from this page and then re-save it from your editor choosing UTF-8 with BOM. Deciding not to exchange IDs and phone numbers as CSV at all is also a legitimate answer, and if the recipient uses Excel, handing over an .xlsx is safer — the types are stored in the file, so opening it changes nothing. |
Normalizing headers to snake_case is an operation that throws the original names away. Headers in non-Latin scripts or containing symbols cannot be restored afterwards — run it once, immediately before loading into a database, and always keep the original file. Recording a mapping of old name to new name lets you answer "what was this column?" later. The line-ending choice is easy to forget because nothing about it is visible: CRLF if the file is going to a Windows tool, LF if it goes into a Unix script or into Git. Commit a mixture and every line shows up as a diff (see the line-ending converter). Finally, because everything runs in the browser, the size you can handle depends on the memory of your machine. For CSV files beyond a few tens of megabytes, use a command-line tool such as csvkit, xsv or duckdb instead of this page — they can process the file without loading all of it into memory.
📖 How to Use
-
1
Paste CSV or TSVPaste your data into the left input. The delimiter can be auto-detected or chosen manually.
-
2
Choose cleaning optionsTick options like dedupe, sort, blank-row removal, and column extraction. Dedup keys and sort columns accept either 1-based numbers or header names.
-
3
Copy or download the resultThe cleaned output appears on the right. Use the Copy button or Download (.csv / .tsv) to export.
❓ Frequently Asked Questions
How are duplicate rows detected?
Are quoted commas and newlines preserved correctly?
Can it handle large CSV files?
🐛 Found a bug or issue with this tool?
Free to use, no signup. Even just the steps to reproduce are helpful. Reports go directly to the operator and help us fix issues.
Thanks for your report!
Your report has been delivered to the operator and will be used to improve the tool.