Primary example
Before
Hello world Second line
After
Hello world Second line
Remove leading and trailing whitespace from whole blocks or each line—choose trim mode when PDF paste adds invisible padding.
Trim Text
Removes whitespace from edges only — spaces inside sentences stay untouched.
Paste or type text to trim edge whitespace.
Whitespace Visualizer
space tab nbspWhitespace markers appear here when you paste text.
Your text stays in your browser — nothing is uploaded.
Padded text
Hello world Second line
Trimmed per line
Hello world Second line
Before
Hello world Second line
After
Hello world Second line
Trim Text strips whitespace from the edges of your content according to the selected mode. Per-line trim fixes indented exports; whole-block trim cleans a single string bounded by spaces. It complements Remove Extra Spaces, which targets duplicate gaps inside lines rather than edges.
Cleaning code paste with accidental leading spaces
Removing padding from spreadsheet cell exports
Preparing trimmed strings before slug generation
Fixing YAML or config values with trailing newlines
Paste text with unwanted spaces at line starts …
Select trim mode: all, each line, or leading/tr…
Review tightened output without altering mid-li…
Copy trimmed text for publishing or diffing.
Cleaning code paste with accidental leading spaces
Removing padding from spreadsheet cell exports
Preparing trimmed strings before slug generation
Fixing YAML or config values with trailing newl…
All processing runs locally in your browser. Results may vary with edge-case characters or very large inputs.
No. Use Remove Extra Spaces for internal duplicate spaces.
Yes. Leading and trailing tab characters are removed in trim modes.
Choose a mode that targets leading whitespace if available in controls.
Whitespace-only lines may become empty; use Remove Empty Lines afterward.