A per-line whitespace (or character-class) stripper
Default mode strips whitespace: spaces, tabs, and non-breaking-space-equivalents that `String.prototype.trim` handles. Each line is trimmed independently - the middle of each line is untouched. Blank lines that only contain whitespace trim to empty strings (they stay in the output as empty lines unless you follow up with Remove empty items).
The Side option controls which ends get trimmed. Both (default) removes leading and trailing. Start only removes leading; End only removes trailing. Useful when the whitespace is intentional on one side - e.g. preserving indentation while cleaning trailing spaces.
Chars to trim lets you swap whitespace for any character class. Type `"` to strip surrounding double quotes; `[]` to strip brackets; `".,` to strip any of those. The characters are regex-escaped internally so you do not need to escape special regex characters yourself.
How to use trim list items
- 1Paste your list into the input panel
- 2Pick Side: Both (default), Start only, or End only
- 3Leave Chars to trim blank for default whitespace, or type a character set
- 4Output updates live with each line trimmed independently
- 5Copy or download; pair with Remove empty items to drop now-blank lines
Keyboard shortcuts
Drive ListShift without touching the mouse.
What this tool actually does
Two options covering whitespace and custom character trimming.
Default whitespace stripping
When Chars to trim is blank, the tool uses `String.prototype.trim` (both sides), `replace(/^\s+/)` (start only), or `replace(/\s+$/)` (end only). Matches the Unicode whitespace set the browser recognises.
Custom character set trimming
Fill in Chars to trim with any characters you want treated as trimmable. Characters are regex-escaped internally, so `.+*[]` work as literal characters. Trims runs of any of the listed characters from the chosen side.
Per-line independent trimming
Every line is trimmed in isolation. Leading whitespace on line 2 does not affect line 3. Middle whitespace is never touched - for collapsing runs of internal spaces, use Replace with Regex on, Find `\s+`, Replace ` ` (single space).
Side toggle for asymmetric trimming
Pick Start only to preserve intentional trailing spaces (e.g. indented list markers). End only preserves leading indent while cleaning trailing noise. Both (default) handles the common case.
Blank lines remain in output
If a line contained only whitespace, it trims to an empty string - but the line itself stays in the output. The tool does not collapse or drop blank lines; use Remove empty items for that.
Worked example
Default Both side, Chars blank - whitespace stripped from every line.
"Apple" "Banana" "Cherry"
"Apple" "Banana" "Cherry"
Settings reference
How each option shapes the trimmed output.
| Setting | What it does | Effect on the sample |
|---|---|---|
| Side: Both (default) | Trims from leading and trailing ends | All surrounding whitespace removed |
| Side: Start only | Trims only the leading end | Leading spaces gone; trailing spaces kept |
| Side: End only | Trims only the trailing end | Leading spaces kept; trailing spaces gone |
| Chars to trim: (blank) | Uses Unicode whitespace as the trim set | Strips spaces, tabs, NBSP-equivalents |
| Chars to trim: `"` | Strips the specified character(s) instead of whitespace | `"Apple"` becomes `Apple` (surrounding quotes gone) |