Neatbo.

Clean CSV

Remove duplicate rows by the columns you choose, with optional empty-row removal.

Browser-local processingInputCSVOutputCSVUp to 10 MiB per file · File limit: 1
  1. 1Add input
  2. 2Adjust settings
  3. 3Get your result

Tool input and files are processed in this browser without being uploaded.

Your input
Delimited text source
0 characters · 0 bytes

Choose columns to compare

All columns are selected by default. Untick columns you do not want in the duplicate key; all original columns stay in the output.

Paste or choose a CSV file to review its columns.

Options

Complete the required options first. You can keep the defaults for the rest.

Choose comma, tab, semicolon or vertical bar for both input and output. The separator is not detected automatically. Quoted separators, embedded newlines and doubled double quotes are supported.

Use the first row as nonempty header names with no exact duplicates; spaces and case are preserved. Turn this off to keep the first row as data, compare using column_1, column_2 and so on, and export without a header row. Recheck comparison columns after changing this setting.

Remove a row only when every cell is empty or contains only whitespace. This happens before duplicate removal, across the whole row rather than just the comparison columns. Values in retained rows are not trimmed.

Add an apostrophe before cells and headers that start with =, +, - or @ after leading spaces, tabs or line breaks. This changes the exported text, including negative-looking values. Spreadsheet apps may remove the prefix when resaving, so review the result before opening it there.

Add a leading UTF-8 byte order mark to the output for software that expects it. This is off by default and does not fix an incorrectly encoded input file.

Inputs are kept temporarily in this tab when switching tools. Refreshing or closing clears them; large results may need to be regenerated.⌘ / Ctrl + Enter to run

Preparing the tool…

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

  1. 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.
  2. 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”.
  3. 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