Remove extra spaces from list items

Remove extra spaces from list items by stripping leading and trailing whitespace (spaces, tabs) from every line. Does not collapse internal runs of multiple spaces - `hello world` stays as `hello world`. For that, use Replace with a regex.

Input
Ready
Output
Live

A line-ends whitespace stripper

Under the hood this is the trim op with default options: Side Both, Chars empty (fallback to whitespace). Each line gets `line.trim()` applied. Leading and trailing spaces, tabs, and other whitespace characters are stripped. Content in the middle of the line is untouched.

Common point of surprise: extra spaces *between* words are not collapsed. A line like `Fred Smith` stays `Fred Smith`. If you need to collapse runs of internal whitespace to a single space, use Replace with Regex Find `\s+` and Replace text ` ` (a single space).

Change Side to Start or End for one-sided stripping. Fill Chars to trim with specific characters to strip those instead of whitespace (same field used by trim and Remove bullets).

How to use remove extra spaces from list items

  1. 1Paste your list into the input panel
  2. 2Default strips whitespace from both ends of every line
  3. 3Switch Side to Start only / End only for one-sided trimming
  4. 4Leave Chars to trim blank for whitespace; fill it to strip specific characters instead
  5. 5For collapsing internal runs of spaces, chain Replace with regex `\s+` → ` `

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

Same op as trim with identical defaults.

Strips leading + trailing whitespace

Matches `\s` - spaces, tabs, non-breaking spaces (Unicode aware) at each line's start and end. Internal whitespace is preserved.

Does NOT collapse internal runs

`Fred Smith` stays `Fred Smith`. For collapsing, use Replace with Regex on + Find `\s+` + Replace ` `.

One-sided trimming via Side option

Start only for leading strip; End only for trailing. Useful when the whitespace at one end is meaningful and you only want the other cleaned.

Chars to trim for non-whitespace targets

Fill Chars to trim with a character set (e.g. `.,;`) to strip those from the ends instead of whitespace. Whitespace is NOT included automatically - add a space to Chars if you want both.

Empty lines stay empty

A line that is only whitespace becomes an empty line (still present in the output). Pair with Remove empty lines to drop them entirely.

Worked example

Leading and trailing whitespace stripped from every line. Internal content and internal spacing untouched.

Input
  apple
banana
   cherry
	tabbed line	
Output
apple
banana
cherry
tabbed line

Settings reference

How each option shapes the output using the sample above.

Setting What it does Effect on the sample
Side: Both (default), Chars blank Strips whitespace from both ends ` apple ` → `apple`; ` tabbed line ` → `tabbed line`
Side: Start only Strips leading whitespace only ` apple ` → `apple ` (trailing spaces kept)
Side: End only Strips trailing whitespace only ` apple ` → ` apple` (leading spaces kept)
Chars: `a` Strips `a` from the ends (not whitespace) `apple` → `pple`; `banana` → `banan`
Internal spaces (automatic) Never collapsed `Fred Smith` stays `Fred Smith`

FAQ

Does this collapse multiple internal spaces to one?
No. Only leading and trailing whitespace is stripped. `Fred Smith` stays as-is. For internal collapsing, use Replace with Regex + Find `\s+` + Replace ` `.
What counts as whitespace?
JavaScript's `\s` character class: space, tab, line separator, non-breaking space (U+00A0), and other Unicode whitespace. Tabs are handled the same as spaces.
How do I strip characters that are not whitespace?
Fill the Chars to trim field. Example: `.,;` to strip those punctuation marks from the ends. Whitespace is NOT included automatically when you fill Chars - add a space if you want both.
What if a line is only whitespace?
It becomes an empty line (still present in the output list). Chain Remove empty lines to drop those entirely.
How does this differ from Trim?
Same op, same defaults. This page is the search-friendly alias for users looking for "remove extra spaces"; trim is the general-purpose name with the same functionality.