CSV cleaner: trim spaces and tidy messy cells

Exports often carry invisible problems: spaces around names, non-breaking spaces copied from web pages, curly quotes from a word processor, hidden control characters. The cleaner applies the fixes you tick and tells you how many cells it changed.

CSV Cleaner tool

Your file stays in this browser tab. It is not uploaded by SheetShift.

CSV file

Drag a file here, or

Options

How to use the CSV Cleaner

  1. Load your CSV by choosing a file or pasting text.
  2. Tick the clean-up rules you want. Trim, collapse and non-breaking space fixes are on by default because they rarely change meaning.
  3. Press Clean. The summary shows how many cells changed so you can judge the effect.
  4. Check the preview, then download the cleaned CSV. Your original file is never modified.

Example: input and output

This example was produced by the same code the tool runs, with these settings: trim = true, collapse = true, nbsp = true, removeEmptyRows = true, removeControl = true, caseMode = title, smartQuotes = true. You can download the sample file(s): messy-contacts.csv.

Input
name,city,note
"  alice   morgan ",  Austin,ok
Ben·Okafor,"London ",“vip”
,,
  Dev Patel  ,Sydney,new
Output
name,city,note
Alice Morgan,Austin,Ok
Ben Okafor,London,"""vip"""
Dev Patel,Sydney,New

Result summary: Changed 9 cells, removed 1 empty row.

Supported formats

CSV, TSV, TXT. The cleaned file is UTF-8 with the delimiter you choose.

Limitations

  • Case changes apply to every cell, including codes and IDs. Leave the case option off if your data has case-sensitive values.
  • Title Case is simple: it capitalises each word, so "McDonald" becomes "Mcdonald".
  • The tool does not validate emails, dates or numbers.

When this helps

Prepare a mailing list

Trim names and straighten quotes before importing contacts into an email tool that rejects odd characters.

Fix copy-pasted web tables

Data copied from web pages often contains non-breaking spaces that make lookups and joins fail.

Frequently asked questions

What is a non-breaking space?

It looks like a space but is a different character (U+00A0). Formulas such as VLOOKUP treat it as different from a normal space, so matching fails until it is replaced.

Will cleaning change my numbers?

The cleaner only edits text rules you tick. Numbers stay as written, apart from trimming spaces around them.

Can I undo a change?

Your original file is untouched. If the result is wrong, change the options and run it again.

Related tools

Guides: How to clean a messy CSV file, step by step · Why your CSV shows weird characters, merged columns or missing zeros · How to compare two spreadsheets and find what changed

Category: Data Cleaning