How to clean CSV files
Start with pasted CSV or TSV content or a CSV, TSV, or TXT file. CSV & TSV Cleaner reads the fields, repairs rows with uneven field counts, applies the selected cleanup settings, and shows a preview before export. The warnings list calls out merged extra fields and quote characters kept inside unquoted fields.
- Paste CSV or TSV content into the text box, or use
Drop a CSV or TSV file hereand selectbrowse files. The file picker accepts CSV, TSV, and TXT files. - Choose
Input delimiter, then setQuote characterandEscape styleto match the source. - Choose
First row is a header,Trim leading/trailing whitespace,Remove empty / separator-only rows, and any other cleanup settings you need. - Check
Preview of cleaned dataandWarnings. SelectExport CSV/TSVfor the cleaned file, orExport CSVin the warnings section for the warning log.
Repair CSV structure with delimiter and quote settings
Auto-detect reads the first 25 physical lines and compares comma, tab, semicolon, and pipe counts. For another separator, choose Custom… under Input delimiter and enter up to three characters in Custom delimiter. An empty custom value uses a comma. Match Quote character and Escape style to the source, such as Double quote ( " ) with Doubled quote ("").
Encoding controls how an uploaded file is read. The choices are UTF-8 and Latin-1 (ISO-8859-1). Set Output delimiter to Same as input, comma, semicolon, tab, or pipe. Output line endings can keep the detected style or write LF or CRLF.
Clean fields and remove empty rows
With Trim leading/trailing whitespace enabled and Field cleanup set to None (trim only), this input:
name,email,city
Alice, [email protected] ,London
Bob,[email protected],
becomes:
name,email,city
Alice,[email protected],London
Bob,[email protected],
Collapse inner whitespace changes repeated whitespace inside data fields to single spaces. Lowercase and Uppercase change data fields only. The header is trimmed when trimming is enabled. Remove columns that are empty everywhere checks the cleaned data rows, then removes the same positions from the header.
Enable First row is a header when the first parsed row contains column names. Enable Remove empty / separator-only rows to drop rows whose fields contain no value after the cleanup checks.
Repair uneven CSV rows and review warnings
The cleaner counts the fields in each row and uses the most common count. A short row receives empty fields at the end. A long row has its extra fields joined into the final column with the input delimiter, and each repair adds a warning with the row number.
A quote character inside an unquoted field stays as literal text and creates a warning. The preview table shows the first 100 cleaned data rows. Export CSV/TSV writes the full cleaned result. Empty or whitespace-only input keeps the options and workspace hidden.
For an uploaded file longer than 200,000 characters, the text box shows a truncated preview with a notice, while the full loaded text is processed.
Where CSV cleanup comes up
A report export with spaces around email addresses can be trimmed before you pass it to another system. A tab-separated log with short rows can be padded and checked in the warning list.
If a spreadsheet export leaves an empty column, select Remove columns that are empty everywhere and inspect the preview before saving. For inconsistent capitalization in a data import, choose Lowercase or Uppercase when you want to change the field values.
CSV cleaner or Excel cleaner?
Spreadsheet Clean Tools groups cleanup pages for spreadsheet data. Use CSV & TSV Cleaner for delimited text. Choose Excel Cleaner to clean selected sheets in an Excel workbook.
Frequently asked questions
How do I clean TSV files without changing the tab delimiter?
Choose Tab for Input delimiter and Same as input for Output delimiter. The selected field and row cleanup settings still apply.
How can I remove empty rows from CSV files?
Enable Remove empty / separator-only rows. Rows whose fields contain only empty or whitespace values are removed from the data result.
Can CSV & TSV Cleaner repair uneven rows?
Yes. Short rows are padded to the most common field count, while extra fields in long rows are merged into the last column and listed as warnings.
Does CSV & TSV Cleaner upload my file?
No. The page reads an uploaded file with FileReader and processes its text in the browser. The local page script contains no request that sends the file content elsewhere.