CSV & Excel · 5 min read
How to clean a CSV before importing data
Prepare CSV or Excel data for a CRM, database, or store import. Check headers, preserve text IDs, and remove only the duplicates you intend to remove.
By Tool Studio · Published
Put the walkthrough into practice
Import, prepare, and download in one browser tab.
1. Keep the original and check the destination
Make a copy of the export before changing it. Find out which column names, separator, character encoding, date format, and identifier fields the destination accepts. A clean-looking table can still fail an import if its schema is wrong.
The cleaning workflow accepts CSV, TSV, and XLSX. Files stay in your browser tab. It supports files up to 10 MB, 10,000 rows per sheet, 100 columns, and 200,000 cells across the workbook.
2. Select the table and preserve text identifiers
Load your file and choose the worksheet that contains the records. Leave the header option enabled only when the first row contains column names. Inspect account numbers, postal codes, and product codes before making changes.
CSV values remain text during cleanup, including leading zeros and large IDs. In XLSX, numeric cells use their stored number: a displayed 000123 produced by a number format is not the same as a text value of 000123. Convert formatted numeric identifiers to actual text in the source workbook before exporting.
3. Decide what makes two records duplicates
Matching every column removes repeated copies of the same row. Matching selected columns keeps the first row for each combination of those values. For example, matching only Customer ID will also discard later rows with the same ID but different contact details.
Trim whitespace when spaces at the beginning or end are unwanted. Use case-insensitive matching only when the selected identifiers treat upper- and lowercase letters as equivalent. Empty rows are removed separately from duplicate rows.
Customer ID,Name 00123,Alex 00123,Alex Smith All columns: keep both rows. Customer ID only: keep the first row.
4. Review and download the cleaned table
Compare the preview and removal counts with the source. Check that genuine repeated events, such as two purchases by the same customer, were not mistaken for duplicate records. The workflow keeps the first matching record and does not merge fields from competing records.
Download a CSV with the separator your destination requires. Formula-like text is escaped with an apostrophe by default; leave this enabled for spreadsheet use, or choose the exact text representation required by a destination that treats every field as plain data. Test a small import before replacing a production dataset.
Before you finish
- The chosen worksheet and header row are correct.
- Identifier fields retain their leading zeros and full precision.
- The duplicate rule matches the destination's record model.
- The preview and removed-row counts are plausible.
- The destination accepts the downloaded separator and values.
Further reading
Put this guide to work
Clean an import file ↗CSV & Excel Cleaner
Remove duplicate rows, trim whitespace, and clear empty rows from spreadsheet data.
CSV & Excel Converter
Convert CSV, TSV, and Excel workbooks into CSV, TSV, JSON, or XLSX files.
Spreadsheet Editor
Edit and format spreadsheets, filter and sort data, calculate formulas, and export Excel workbooks.