Clean CSV
Remove duplicate rows by the columns you choose, with optional empty-row removal.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Compare all columns or choose the ones that define a duplicate. Clean CSV keeps the first remaining row for each exact match, including its other values, and preserves every column and the order of the retained rows.
How to use this tool
- Choose “Paste text” and enter CSV in “CSV input”, or switch to “Choose CSV file” and select one local file. Set “Delimiter” to match the source.
- Review the parsed “Duplicate key columns” and keep at least one selected. Adjust the header, empty-row, formula-prefix and BOM options, then select “Clean CSV”. If earlier keys are missing, choose current columns or “Select all columns”.
- Compare the input, kept and removed row counts, then inspect the CSV preview. Use “Copy result” or download cleaned.csv for the complete output, including anything beyond the preview limit.
Supported inputs and limits
Use one UTF-8 file up to 10 MiB or paste up to 1 MiB of UTF-8 text. The input may contain at most 200,000 cells, including its header row. Rows must have equal widths. With headers enabled, names must be nonempty and have no exact duplicates.
Files must be valid UTF-8 and have names no longer than 512 UTF-16 code units, including the extension. Duplicate comparisons preserve case and spaces. Removing empty rows only tests whether all their cells contain whitespace or nothing; it does not trim values in the rows that remain.
The text preview shows at most 12,000 Unicode code points; Copy result and the cleaned.csv download include the full CSV. Output is serialized again, so quoting, line endings and optional formula prefixes or a BOM can differ from the source. Keep the original file.
Worked example
Example input
id,value 1,a 1,b 2,c
Example options
{
"keys": "id"
}Example output
id,value 1,a 2,c
When something does not work
Check the delimiter, CSV quoting, row widths and header names, then select at least one current comparison column. Use “Select all columns” if an earlier key is missing. For a file-reading or UTF-8 notice, reselect the file or export a valid UTF-8 copy as appropriate. Run “Clean CSV” again after the column checks pass.
Frequently asked questions
Are my files uploaded?
No. Your CSV text and files are processed in your browser. The same tab may keep a temporary workspace as you move around the site, but it can expire or be replaced. Download any result you need before reloading or closing the tab, and keep your original source.
What should I check in this result?
Check which columns define a duplicate and whether the first kept row has the values you need in the other columns. Case and spaces matter. The removed-row count combines duplicates with any wholly empty rows removed by the optional setting.
Will unselected columns disappear from the output?
No. The selected columns only decide which rows match. Every original column remains, and the first remaining matching row supplies all of its values. In the example, matching on id keeps 1,a and drops the later 1,b row even though value differs.
Documentation & further reading
Related tools
CSV to JSON
Convert CSV or TSV to a JSON array of objects while keeping every cell as a string.
JSON to CSV
Turn an array of JSON records into a CSV table.
View CSV
A clear look at your data, no spreadsheet app needed.
JSON to YAML
Convert JSON to YAML with quoted strings and unchanged number tokens.