About this whitespace/trim tool
Collapse extra whitespace and trim your text. Consecutive JavaScript whitespace characters become a single ordinary space, then leading and trailing whitespace is removed. Work directly with your own text in this browser without signing in or uploading a document. Review the result before copying it into another application, and use Reset to clear the workspace when you are finished. The examples below show the exact behavior to expect, while the limitations explain cases where another workflow may be more suitable.
How the whitespace/trim tool works
Consecutive JavaScript whitespace characters become a single ordinary space, then leading and trailing whitespace is removed.
Whitespace/Trim Tool examples
a b
a b
a b
a b
Limitations & privacy
Line breaks, tabs and nonbreaking spaces are collapsed too. Do not use this to preserve code indentation. Maximum text input: 100,000 UTF-16 units.
Inputs and results stay in this browser. Only tool identifiers are stored for your recently used tools. You can clear that history from the directory.
Whitespace/Trim Tool: frequently asked questions
How does the whitespace/trim tool work?
Consecutive JavaScript whitespace characters become a single ordinary space, then leading and trailing whitespace is removed.
What can I inspect in the whitespace/trim tool result?
The whitespace cleanup report helps you check the result before using it. Line breaks, tabs and nonbreaking spaces are collapsed too. Do not use this to preserve code indentation. Maximum text input: 100,000 UTF-16 units.
Does the whitespace/trim tool upload my input?
Processing happens in your browser. No tool input or output is uploaded to a server. Use Reset to clear the current workspace before starting a separate task.
Updated September 20, 2026