How to trim whitespace from email addresses in a contact csv
- Step 1Export your contact list as CSV — Download from your form tool, CRM, checkout, or previous ESP. Most platforms offer a one-click CSV export of a list or segment.
- Step 2Drop the CSV onto the trimmer — Trimming runs automatically on load. There is no email-column selector — every column is trimmed at once, which keeps names and source fields clean too.
- Step 3Read the Cells trimmed count — The panel shows
Cells trimmedandData rows. A high trim count on a mailing list is normal when contacts came from mobile signups. - Step 4Preview the first 10 rows — Confirm the email column now starts and ends with the address and nothing else. The header row is trimmed too.
- Step 5Download the cleaned CSV — Click Download. The file is saved with a
.trimmed.csvsuffix so your original export is preserved. - Step 6Import into your ESP — Upload to Mailchimp, Klaviyo, Kit, or Brevo. The previously skipped padded-email rows now import as valid contacts.
How ESPs react to whitespace in the email column
Documented behaviour of major email platforms when an imported email contains leading or trailing whitespace. Trimming first avoids all of these.
| Platform | Behaviour on padded email | Where you find out |
|---|---|---|
| Klaviyo | Treats whitespace in the email as invalid format and skips the row on import | Listed in the import-result download as a skipped record |
| Mailchimp | Padded address fails validation and is rejected; case-different copies may silently merge on re-import | 'Some addresses were rejected' summary after import |
| Kit (ConvertKit) | Whitespace breaks the unique-email key, so a padded copy can create a second subscriber | Duplicate subscriber count after import |
| Brevo | Trailing-space email can import as a distinct contact, inflating list size and send cost | List count higher than expected |
What the trimmer fixes vs. what it leaves
Whitespace position determines whether this tool acts. Use a sibling tool for the cases it does not handle.
| Case | Example | Result |
|---|---|---|
| Leading space on email | jane@x.com | Trimmed to jane@x.com |
| Trailing space on email | jane@x.com | Trimmed to jane@x.com |
| Leading/trailing tab or newline | jane@x.com\t | Trimmed to jane@x.com |
| Space inside the address | jane @x.com | Preserved — review manually, use csv-find-replace to strip |
| Mixed case duplicate | Jane@x.com vs jane@x.com | Not changed — lowercase with csv-case-converter |
Cookbook
Real before/after rows from contact exports. Email and name values anonymised; arrows mark the invisible whitespace.
Leading space from mobile autocomplete
ExampleA signup form on a phone autocompleted the email and left a leading space. Klaviyo's import would skip this row as invalid. Trim removes the space so it imports cleanly.
Before (space before the email): Email,First Name,Source jane@example.com,Jane,Signup form jon@example.com,Jon,Signup form After trim: Email,First Name,Source jane@example.com,Jane,Signup form jon@example.com,Jon,Signup form Result panel: Cells trimmed: 1 · Data rows: 2
Trailing space breaks email deduplication
ExampleThe same contact was captured twice — once clean, once with a trailing space. As raw strings they are not equal, so a dedupe step misses them. Trimming first makes them identical so the dedupe tool can collapse them.
Before: Email,First Name max@example.com ,Max max@example.com,Max After trim (now identical, ready to dedupe): Email,First Name max@example.com,Max max@example.com,Max Next step: run csv-deduplicator on the Email column.
Padded names break personalisation tokens
ExampleFirst-name cells picked up trailing spaces from a paste. The merge tag rendered 'Hi Sarah ,' with an awkward space before the comma. Trimming every column fixes the names alongside the emails.
Before: Email,First Name sarah@example.com,Sarah ben@example.com, Ben After trim: Email,First Name sarah@example.com,Sarah ben@example.com,Ben
Tab dragged into the email cell
ExampleA copy-paste from a help-desk tool left a literal tab at the end of each email. Invisible in Excel, fatal at import. Trim removes the edge tab.
Before (\t = literal tab in the cell): Email,First Name lee@example.com\t,Lee After trim: Email,First Name lee@example.com,Lee Result panel: Cells trimmed: 1 · Data rows: 1
Internal space left untouched for review
ExampleAn email with a space in the middle is bad data, not just padding. The trimmer deliberately leaves it so you catch and fix it rather than silently shipping a broken address.
Before: Email,First Name amy @example.com ,Amy After trim (only the trailing space goes): Email,First Name amy @example.com,Amy The internal space remains — review this row manually.
Errors and edge cases
Real errors and silent failures sourced from each platform's own documentation. Match the wording to the row, fix what the row says to fix.
List has more than 500 contacts on the free tier
Rejected (over 500)Free runs cap at 500 data rows. A mailing list usually has more, so the run blocks with an upgrade prompt. Export a single segment under 500 contacts, or upgrade — Pro raises the limit to 10,000 rows per job.
Export file is larger than 2 MB
Rejected (too large)Free accepts files up to 2 MB. Long subscriber lists with many custom fields can exceed this. Trim a smaller export, or upgrade to Pro (5 MB).
Space inside the email address
PreservedThe trimmer only strips leading and trailing whitespace, so jane @example.com keeps its internal space. That is intentional — an internal space means the address itself is malformed and needs human review, not silent editing.
Mixed-case duplicate emails
Use sibling toolJane@x.com and jane@x.com are the same mailbox but different strings. Trimming does not change case, so it will not merge them. Run csv-case-converter to lowercase the email column, then csv-deduplicator.
Non-breaking space before the email
TrimmedA NBSP (U+00A0) at the start or end of an email — common from pasting out of a web page — is removed, because it counts as ECMAScript whitespace. A zero-width space (U+200B) is not removed; if a clean-looking email still fails, suspect U+200B and use the special-char stripper.
Trimming exposes duplicates but does not remove them
Use sibling toolAfter trimming, jane@… and jane@… become identical rows. The trimmer leaves both. Follow with csv-deduplicator on the Email column to keep one.
XLSX contact export is rejected
Rejected (wrong type)Only .csv, .tsv, and .txt are accepted. Save an .xlsx export as CSV first (File → Save As → CSV UTF-8), then drop it in.
Tags column has spaces after commas
PreservedA Tags cell like vip, beta, 2026 is trimmed only at its outer edges — the spaces after the internal commas stay. Use csv-find-replace to normalise , to , if your ESP treats beta and beta as different tags.
Quoted email-display-name field stays intact
PreservedA cell like "Jane Doe <jane@x.com>" is parsed as one field by PapaParse and trimmed only at the edges. The internal spaces and angle brackets are preserved exactly.
Frequently asked questions
Does this remove spaces inside email addresses?
No. It removes only leading and trailing whitespace. An internal space, like jane @example.com, is preserved so you can review it — an internal space usually means the address itself is broken.
Why does my form tool produce emails with leading spaces?
Most form tools trim on submit, but copy-paste from spreadsheets, mobile autocomplete, and bulk imports from another system routinely introduce leading or trailing spaces that the source UI hides.
Can I trim only the Email column?
No. The tool has no column picker — it trims every cell in one pass. For a contact list that is helpful, because First Name, Last Name, and tag columns pick up the same padding as the email.
Will trimming fix duplicate contacts?
It makes padded duplicates into identical strings, but it does not delete the extra row. Run csv-deduplicator on the email column afterwards to collapse them.
Does it lowercase email addresses?
No. It only removes surrounding whitespace. To collapse case-different duplicates, lowercase the email column with csv-case-converter first, then dedupe.
Are tabs and newlines removed?
Yes, when they sit at the start or end of a cell. String.trim() removes spaces, tabs, carriage returns, and newlines from the edges of each value.
Is the header row trimmed too?
Yes. Header cells are trimmed along with the data, so a padded column name like Email becomes Email, matching what your ESP's column mapper expects.
What are the file and row limits?
Free runs handle up to 2 MB and 500 data rows per job. Pro raises this to 5 MB and 10,000 rows. Larger lists need Pro or should be exported in segments.
Is my subscriber data uploaded?
No. PapaParse parses and trims the file entirely in your browser. Subscriber emails and names never reach a JAD Apps server.
What is the output filename?
The downloaded file gets a .trimmed.csv suffix, so your original export stays untouched and you can re-run if needed.
Does it remove non-breaking spaces from emails?
At the cell edges, yes — a leading or trailing NBSP (U+00A0) is treated as whitespace and removed. A zero-width space (U+200B) is not removed; use the special-char stripper for that.
Should I trim before or after splitting tags into columns?
Trim first to clean the whole file, then use csv-column-value-splitter or csv-find-replace on the tags. Trimming the outer cell does not affect spaces between comma-separated tags.
Privacy first
Processing runs locally in your browser with PapaParse. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.