SmartKitio

Trim Text

Strip spaces and tabs from the start and end of every line, for example to remove indentation or trailing whitespace.

Your text stays in your browser.

Input
Output

About this tool

Each line is trimmed of leading and trailing whitespace, then the whole block is trimmed so there are no blank lines at the very start or end. Spaces inside a line are not changed; use Remove Extra Spaces to collapse those.

How to use it

  1. Paste your text or list.
  2. Copy the trimmed output.
line.trim() then join

Examples

  • Indented list

    " apple" and " banana " become "apple" and "banana".

  • Inner spaces kept

    " a b " becomes "a b"; the three inner spaces stay.

FAQ

Will it break code indentation?
Yes. All leading whitespace is removed, which flattens indentation. Do not use it on code where indentation matters, such as Python or YAML.
Are blank lines in the middle removed?
No. Only blank lines at the very start and end go. Use Remove Empty Lines for the rest.
Is my text uploaded?
No.