← CSV Repair & Deduper (offline browser tool)

Why you should test any CSV cleanup script on a small sample first

Running an untested script on your entire dataset the first time is how small bugs turn into large data-loss incidents. Here's a safer workflow.

Before you work through this by hand: you can check your own CSV free and see which of these problems your file actually has — duplicate rows, near-duplicates, broken quoting, encoding damage. It runs in your browser tab, nothing is uploaded, and there's no signup or email.

Why the first run shouldn't be the full file

A script that looks correct can still have an off-by-one bug in a filter condition, an unintended how='any' instead of how='all', or a column-name typo that silently matches nothing. On a 50,000-row file, that kind of bug can delete or corrupt thousands of records before anyone notices, whereas the same bug on a 20-row sample is obvious immediately.

Making a representative sample

import pandas as pd; df = pd.read_csv('file.csv'); df.sample(50, random_state=1).to_csv('sample.csv', index=False) — a random sample (rather than just the first 50 rows) is more likely to include the edge cases that are actually spread through the file: blank fields, unusual characters, near-duplicates.

What to check after running on the sample

Compare the row count before and after (does it match what you expected to be removed?), spot-check a handful of individual rows against what you know about the source data, and specifically look at any row that seems to have changed in a way you didn't anticipate.

Only then run on the full file, and only on a copy

Once the sample run looks correct, run the same script on the full file — but on a copy, not the original, per our backup guide. A script that behaves correctly on a small sample can still behave differently at scale (e.g. performance issues, or an edge case the sample happened not to include), so it's still worth a final row-count/spot-check pass on the full output.

This is exactly why our guided demo exists

The interactive sample-data demo on this page follows the same idea: it shows you the real dedup/repair logic operating on a small, known dataset first, so you can see exactly what it would do before running it on your own file.

$19 one-time payment. No subscription. If you'd rather skip the manual steps above, CSV Repair & Deduper (offline browser tool) automates the duplicate-finding and review step for you, entirely on your own device.

See CSV Repair & Deduper (offline browser tool) — $19 one-time

See all free guides