Text Trimmer
Trim whitespace from each line or the whole text and collapse extra inner spaces.
About the Text Trimmer
This text trimmer removes unwanted whitespace from your text so it is clean and consistent.
Trim both ends of every line, trim only the start or end of the whole text, and collapse runs of inner spaces down to one.
It is handy for tidying data copied from spreadsheets, PDFs and web pages where lines are padded with stray spaces or tabs.
Key features
- Trim leading and trailing spaces on each line
- Trim only the start or end of the whole text
- Collapse repeated inner spaces
- Copy the cleaned text instantly
How to use
- 1Paste your text into the box.
- 2Choose which trimming options to apply.
- 3Click Trim text and copy the result.
Examples
' hello ' and ' world 'hello / world (spaces removed)Leading and trailing spaces are stripped from every line.
Frequently asked questions
- What is the difference between trim each line and trim start of text?
- Trim each line removes spaces at both ends of every line. Trim start of text only removes whitespace at the very beginning of the whole block.
- Does collapse inner spaces affect line breaks?
- No. It only reduces runs of spaces and tabs within a line to a single space; line breaks are kept.
- Is my text uploaded anywhere?
- No. Trimming happens entirely in your browser, so your text never leaves your device.
Continue your workflow
Open a related tool to prepare your files or refine the finished result.
- Text ToolsText Cleaner
Trim lines, collapse extra spaces and remove blank lines.
Open tool - Text ToolsText Cleaner Advanced
Developer whitespace fixer: tabs and spaces, line endings, indentation and trailing spaces.
Open tool - Text ToolsDuplicate Line Remover
Remove repeated lines, keeping the first or last, with optional case and space matching.
Open tool
