Trim — remove spaces
Remove spaces at edges, extra spaces and line breaks
Source text ⓘ
Enter text with extra spaces or line breaks.
Result ⓘ
FAQ about removing spaces ⓘ
Answers about trim and removing extra spaces in text online.
What is text trim?
Trim is removing spaces at the start and end of a line. When copying text from documents or web pages, extra spaces often appear at the edges. Online trim removes them in a second. You can also collapse multiple spaces and extra line breaks for consistent formatting.
Why remove extra spaces?
Extra spaces reduce readability, increase file size and can break formatting in code. Removing spaces online helps when preparing text for publication, SEO content and code. Consistent formatting matters for professional documents.
How does «collapse spaces» differ from trim?
Trim removes only spaces at the edges. Collapse spaces — replace several consecutive spaces with one. Useful when space was pressed multiple times by accident. Both options can be used together in our free tool.
Is it safe to use trim online?
Yes. Processing runs in the browser. Text is not sent to the server or stored. Suitable for confidential documents.