Line-edge guide
What leading and trailing whitespace means
Leading whitespace appears before the first visible character on a line; trailing whitespace appears after the last visible character and before the line ending. It is easy to miss because the right edge usually draws nothing. This tool checks each line separately instead of trimming only the beginning and end of the entire text block.
Input markers:
[TAB]Indented item[SPACE][SPACE]
[SPACE][SPACE]Second item[TAB]
Trailing-only mode:
[TAB]Indented item
[SPACE][SPACE]Second itemThree modes with different consequences
| Mode | Indentation | Right edge |
|---|---|---|
| Both edges | Removed. | Removed. |
| Leading only | Removed. | Preserved. |
| Trailing only | Preserved. | Removed. |
When trimming is useful
- Cleaning list items copied from an indented document.
- Removing invisible right-edge characters before a text comparison.
- Preparing imported values while retaining their line structure.
- Cleaning trailing whitespace without flattening code indentation.
When whitespace is meaningful
- Python and other indentation-sensitive languages use leading spaces as syntax.
- Markdown can use trailing spaces to request a hard line break.
- Plain-text tables may rely on both leading and trailing padding.
- Preformatted documents may intentionally align content with spaces or tabs.
Which characters are trimmed
The line-edge matcher includes ordinary spaces, tabs, non-breaking spaces, and other Unicode characters recognized as whitespace by JavaScript. It does not include the CR or LF characters that form the line ending. Internal whitespace between visible characters is preserved even when several spaces occur together.
Line endings remain unchanged
Unlike tools that normalize or join lines, this transformation retains the original LF, CRLF, or CR sequence. Only the adjacent horizontal whitespace at the selected edge is removed. The live audit reports affected lines and character totals for both sides, so you can decide whether a trailing-only cleanup is safer than removing indentation.
Related cleanup choices
If a document contains whole whitespace-only rows, use Remove Empty Lines. If the problem is U+0009 tabs inside a line, the tab tool can replace, remove, or expand them. If regular and Unicode whitespace should be collapsed throughout a line, return to the main space remover.