Trim list items

Paste a list and get each item trimmed. Default strips whitespace from both ends of each line; you can restrict to start or end only, or trim a custom character set instead of whitespace (e.g. quotes, brackets, or trailing punctuation).

Input
Ready
Output
Live

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

  1. 1Paste your list into the input panel
  2. 2Pick Side: Both (default), Start only, or End only
  3. 3Leave Chars to trim blank for default whitespace, or type a character set
  4. 4Output updates live with each line trimmed independently
  5. 5Copy or download; pair with Remove empty items to drop now-blank lines

Keyboard shortcuts

Drive ListShift without touching the mouse.

Shortcut Action
Ctrl ZUndo last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor
EscExit fullscreen
Ctrl KOpen the command palette to jump to any tool
Ctrl SSave current pipeline draft Plus
Ctrl PRun a saved pipeline Plus

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.

Input
  "Apple"
  "Banana"
"Cherry"   
Output
"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)

FAQ

Does Chars to trim remove the character from the middle of items?
No. Trimming only affects runs of the listed characters at the chosen end(s). Middle occurrences are untouched. For middle-of-item character removal, use Delete text or Replace.
Are regex special characters like `.` or `*` handled literally?
Yes. The tool escapes regex-special characters inside Chars to trim, so `.+*[]` are treated as those literal characters, not as regex metacharacters.
What counts as whitespace when Chars to trim is blank?
The Unicode whitespace set that `String.prototype.trim` uses - space, tab, newline (inside a line - not the line-break itself), form feed, non-breaking space, and a few other obscure whitespace code points.
Does it collapse multiple internal spaces?
No. Trimming only works on line ends. For collapsing runs of spaces inside items (`hello world` → `hello world`), use Replace with Regex on, Find `\s+`, Replace with a single space.
What happens to lines that become empty after trimming?
They stay in the output as empty lines. To drop them, chain Remove empty items after - or use a saved Pipeline in Plus to do both in one click.