Trim TSV Columns
Remove the whitespace around cell values. This looks trivial and fixes a disproportionate number of real problems: "Berlin " doesn't equal "Berlin", so it forms its own group, fails every join, survives every dedupe, and produces two categories where there should be one — all completely invisibly, because the difference is a space.
How to use
- Paste or drop the file.
- Choose the trim mode — both ends, leading only, or trailing only.
- Copy or download. The status line reports how many cells changed.
Where the spaces come from
Spreadsheet round trips, where someone typed a trailing space. Fixed-width exports converted to delimited, which pad every field. Copy-paste out of a PDF or a web page. And \r from Windows line endings, which lands on the last field of every row and behaves exactly like trailing whitespace — if only your last column has the problem, that's the cause, and normalise line endings is the proper fix.
The diagnostic is quick: run value counts on a suspect column with and without ignore surrounding spaces. If the distinct count drops, whitespace is splitting your values.
Trim before you join, group, or dedupe
All three compare values literally, so all three are silently wrong on untrimmed data — a join drops rows that should have matched, a group-by reports two groups instead of one, a dedupe keeps duplicates. Trimming first costs one step and removes the whole class of problem. Note that trimming only affects the ends: whitespace inside a value is left alone, since New York with a double space needs a judgement call about which is correct, and find and replace in regex mode (\s+ → single space) is where you make it.
FAQ
Does it trim the header row too?
Yes — and that matters, because a header with a trailing space means every tool that addresses that column by name fails to find it. Header tools has a trim action for the header alone.
What counts as whitespace?
Spaces, tabs, carriage returns, and newlines. A tab or newline inside a field means the value was quoted in the source — trimming those ends is safe and usually what you want.
Can I trim just one column?
Not on this page; it applies to every cell. For a single column, find and replace in regex mode with ^\s+|\s+$ and an empty replacement.
Will a cell of only spaces become empty?
Yes. That's usually the right outcome — it was never a value — and it means stats will now count it as a null.
Privacy
100% client-side. No upload. See the privacy policy.