Skip to content

Trim Spaces: Remove Extra Spaces from Cells

Trim spaces is a free OpenAnyDoc tool. Drop a CSV or Excel file and clear the stray spaces from one column or from every cell.

Runs on your device: no upload, no sign-up, no ads How to check

Try a sample file:

You can also paste CSV text with Ctrl+V (⌘+V on a Mac).

  • CSV: View and edit. .csv, .tsv, .tab, .xlsx, .xls, .xlsm, .ods
Paste text instead

Pasted text stays in this tab and is never sent anywhere.

How it works: trim spaces in a CSV

  1. Open your file

    Drop a CSV or Excel file, choose it, paste CSV into the paste box, or try one of the samples.

  2. Trim a column or the whole file

    In the bar above the table, choose a column and press Trim spaces, or press Trim all cells.

  3. Check it

    The cells change at once, and a message says when there was nothing to trim. Undo puts them back.

  4. Download

    Save the result as CSV, or as Excel, Markdown, HTML or SQL.

Trim spaces: what it can't do

  • No fixed limit; it depends on your device's memory
  • A line break or a tab inside a cell is also replaced by a single space.
  • Column names in the header row are not trimmed.
  • Excel files: only the first sheet is opened.

Trim spaces: questions and answers

Is my file uploaded?
No, your file is not uploaded: your browser trims the cells on your device; nothing is sent to a server.
Which spaces are removed?
The spaces before and after a cell's text, and any run of spaces inside it, which becomes one space: " Jonas Weber " turns into "Jonas Weber".
Can I trim only one column?
Yes, you can trim a single column: pick the column in the bar and press Trim spaces; the other columns stay as they were. Trim all cells does the whole file.
Does trimming spaces change line breaks inside a cell?
Yes, line breaks inside a cell are changed: a line break or a tab inside a cell counts as space and becomes a single space, so trim only the columns where that is what you want.
Are the column names trimmed too?
No, column names are not trimmed: only the cells under the header row change. Rename a column in the table to tidy its name.
Can I undo trimming spaces?
Yes, trimming can be undone: Undo puts the cells back as they were.

Why it's private: your files never leave your browser

Many online file tools upload your file, so a copy of it leaves your device. OpenAnyDoc works the other way round: your browser reads the file and draws it on your screen. Nothing is uploaded, there is no account, and the file is gone from memory when you close the tab, so there is nothing for us to store, see or lose.