Trim Whitespace in Excel Files Online
Trim leading and trailing whitespace from all text columns in Excel files, directly in your browser. No upload required.
How to trim Whitespace in Excel files
- Drop your file onto the upload area. The tool loads it and reports how many text columns will be trimmed.
- Check the column chips. Highlighted columns are text and will be trimmed. Number, date and boolean columns are shown unhighlighted and are left alone.
- Click Trim Whitespace. The preview updates to show the trimmed values.
- Click Download to save the cleaned file in the same format you uploaded.
Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.
Worked example
Wholesale orders were keyed in through a web form, and some product codes and customer names picked up stray spaces. A lookup on product code is failing for those rows.
Input (Excel)
Excel workbook, first sheet (Sheet1)
| product_code | customer | qty |
|---|---|---|
| PX-204 | Blue Harbor Cafe | 12 |
| PX-310 | Lindqvist AB | 4 |
| PX-118 | Casa Moreno | 20 |
| PX-204 | Blue Harbor Cafe | 6 |
Settings
- No options. Every text column is trimmed: product_code and customer.
Result
| product_code | customer | qty |
|---|---|---|
| PX-204 | Blue Harbor Cafe | 12 |
| PX-310 | Lindqvist AB | 4 |
| PX-118 | Casa Moreno | 20 |
| PX-204 | Blue Harbor Cafe | 6 |
Spaces at the start and end of each text value are removed, so both PX-204 rows now carry the same code and the same customer name. The double space inside "Blue Harbor Cafe" is kept, because only the ends of a value are trimmed. qty is numeric, so it is not touched.
Working with Excel files
Workbooks collect leading and trailing spaces from copy and paste, from people adding a space for alignment, and from exports of other systems. Excel's own TRIM function needs a helper column for each field. Here every text column on the first sheet is trimmed in one pass. Spaces often hide in cells holding codes, such as SKUs or account numbers, and break VLOOKUP and XLOOKUP matches.
Text copied from web pages often carries non-breaking spaces, character 160, which look like ordinary spaces but are not removed by this trim. Use Find & Replace for those. Numbers are read as Excel displays them, so a currency-formatted column arrives as text and is trimmed like any other text column. The download is a new Sheet1 workbook with values only. Formula cells are replaced by their trimmed results. Cells that held only spaces come out as empty strings, which Excel shows as blank. Dates and plain numbers are not touched.
Frequently Asked Questions
Is this the same as Excel's TRIM function?
Not quite. Excel's TRIM also collapses repeated spaces inside the text into one. This tool removes spaces only at the start and end of each value and leaves inner spacing as it is.
Why is there still a space at the start of some Excel cells?
It is probably a non-breaking space (character 160), common in text pasted from websites. It looks like a space but is not removed. Replace it with Find & Replace.
Which characters are removed?
Ordinary space characters at the start and end of each text value. Tabs, line breaks and non-breaking spaces are not removed, and spaces between words are kept.
Can I choose which columns to trim?
No. Every text column is trimmed automatically, and non-text columns are left alone. To trim only some columns, use the SQL Query tool with TRIM on those columns.
Why trim before deduplicating or joining?
Matching is exact, so "PX-204" and "PX-204 " count as different values. Trimming first lets duplicates, lookups and joins match as expected.
Related Tools
Deduplicate Excel Files Online
Remove duplicate rows from Excel files instantly in your browser. No upload, no server — 100% private.
Convert Case in Excel Files Online
Convert text columns to UPPERCASE, lowercase, or Title Case in Excel files directly in your browser. Apply case conversion to any or all text columns at once — no upload required.
Find & Replace in Excel Files Online
Find and replace text values in Excel files directly in your browser. Supports plain text and regex patterns across any column — no upload required.
Trim Whitespace in CSV Files Online
Trim leading and trailing whitespace from all text columns in CSV files, directly in your browser. No upload required.
Trim Whitespace in Parquet Files Online
Trim leading and trailing whitespace from all text columns in Parquet files, directly in your browser. No upload required.
Trim Whitespace in JSON Files Online
Trim leading and trailing whitespace from all text columns in JSON files, directly in your browser. No upload required.
Excel Viewer Online
View and inspect Excel files directly in your browser. Browse rows, check column names and data types — no upload required, your data stays on your device.
Convert Excel to Parquet Online
Convert Excel files to Parquet format directly in your browser. No upload required — your data never leaves your device.