Skip to content

Free · Browser-local tools

Clean CSV data

Choose trimming, duplicate-key and empty-row cleanup. Review changes, apply with undo, or copy and download the complete CSV.

Clean CSV

Start with your CSV

Open your file in the CSV editor with this tool already selected. Preview the result before downloading.

  1. Open your CSV and choose cleanup operations.
  2. Inspect before/after values and changed-cell or removed-record counts.
  3. Copy, download or apply the result with undo.

Free · No signup · File contents stay in your browser.

Try a small example

4 records · 3 columns
Illustrative CSV sample data
idnameamount
1 Example one 12
1Example one12
2Example two24
(empty)(empty)(empty)

After trim and exact duplicate removal

After trim and exact duplicate removal
idnameamount
1Example one12
2Example two24
(empty)(empty)(empty)

Illustrative fictional data. Open the sample to try the tool.

Try trimming and removing duplicates

See the dirty records sample for its source and column guide. Download the dirty records CSV and open it above.

Enable Trim whitespace and Remove duplicates, then choose Preview result. The first two records match after trimming, so the preview shows one duplicate removed.

How to clean csv

  1. 1

    Open your CSV and choose cleanup operations.

  2. 2

    Inspect before/after values and changed-cell or removed-record counts.

  3. 3

    Copy, download or apply the result with undo.

What to expect

Choose trimming, empty-row removal and duplicate removal independently. Scope trimming to selected columns and choose duplicate-key columns, matching rules and first or last record retention. Preview the result and download original removed records for an audit; missing values are not inferred.

Local files and clear limits

These tools process file contents on your device. The browser workspace accepts files up to 1 GiB and 5 million records, subject to available browser storage and decoded-record limits. This tool's calculations support up to 100,000 records, 2 million cells and 64 MB of text. Download a new copy to keep your result.

Plain answers

Clean CSV questions

What can I do with this clean csv tool?

Choose trimming, empty-row removal and duplicate removal independently. Scope trimming to selected columns and choose duplicate-key columns, matching rules and first or last record retention. Preview the result and download original removed records for an audit; missing values are not inferred.

Does my CSV leave my device?

File selection, editing and these task operations run in your browser. Optional recipe assistance, when available, sends your goal and only the column metadata or sample values you explicitly include to its configured provider. Your file is not attached automatically; see Privacy for processing details. Manual editing requires no account or file upload. Download a new copy to keep your result; refreshing restores the original input, not unsaved edits.

Can AI help me build a CSV recipe?

When assistance is available, open Recipes in the editor Tools. Capture selected column metadata, review and explicitly include it, then describe your goal. Review the draft settings before importing them. Complete-source Preview and a separate Apply or export are still required; unsupported drafts are refused. You can build recipes manually without assistance.

How do I choose duplicate matches and audit removed rows?

In Clean CSV, enable Remove duplicates, choose Duplicate key columns and set Keep duplicate to First matching record or Last matching record. Trim comparison keys only and Ignore comparison key case change matching without rewriting retained values. Turn off Trim whitespace if you want to retain the original cell text. For example, keys “ A ” and “a” match when both comparison choices are enabled, while “001” and “1” remain distinct. Selected cell trimming runs first, followed by optional empty-row removal and duplicate comparison. Preview result shows the first 5 records and 160 characters per cell; the counts cover the complete bounded source. Download CSV includes every retained result record. Download removed rows includes every original removed record, unchanged raw headers and an added Original source row column numbered from the first data record. These separate copies do not change the open document. Apply to table (undo available) changes it only after your review. Changing the document or cleanup choices requires a fresh preview. This browser task supports 100,000 records, 2 million cells and 64 MB of decoded text; installed apps and extensions need their own host support.

Do the editor and task have the same file limits?

The editor opens files up to 1 GiB and 5 million records, subject to browser storage and decoded-record limits. This task supports up to 100,000 records, 2 million cells and 64 MB of decoded text.

Other ways to work with your CSV

Use these local examples when you prefer a script or SQL. They create separate results and explain where their behavior differs from this browser tool.

Trim and remove duplicate CSV records with Python

Writes trimmed nonempty records and retains the first occurrence of each complete trimmed record.

Before you start

  • Python 3.10 or later. Run in a working folder with a backup of your source; output files may be replaced unless opened in exclusive mode.
  • Place input.csv in that folder. Examples use UTF-8, a comma delimiter and a header row. Column-specific recipes use id,label,amount,status,note; adapt names to your file.
Run the complete Python example
python3 - <<'PY'
import csv

with open("input.csv", encoding="utf-8-sig", newline="") as source:
    table = list(csv.reader(source, strict=True))
if not table:
    raise ValueError("Expected a header row")
headers, rows = table[0], table[1:]
if any(len(row) != len(headers) for row in rows):
    raise ValueError("Every record must match the header width")

cleaned = []
seen = set()
for original in rows:
    row = [value.strip() for value in original]
    key = tuple(row)
    if any(row) and key not in seen:
        cleaned.append(row)
        seen.add(key)
rows = cleaned

with open("output.csv", "w", encoding="utf-8", newline="") as target:
    writer = csv.writer(target)
    writer.writerow(headers)
    writer.writerows(rows)
print(f"Wrote {len(rows)} records to output.csv")
PY

Limits and output

  • CSV has no stored type schema. Python keeps fields as strings until an example explicitly converts a value. These recipes do not add spreadsheet formula protection; import sensitive-looking strings as text in spreadsheets.
  • Trimming changes cell text. This example compares every column; choose a subset of key columns explicitly for a different duplicate rule. Keep the source to audit removed rows.
  • This recipe retains the parsed table in memory; use a streaming approach for files that do not fit.

Documentation: Python CSV reader and writer