Text Trimmer

Tidy the edges of your text and cut it to size. Trim spaces from the whole text or from every line, remove blank lines at the start and end, strip chosen characters such as bullets or dashes from line edges, and truncate to a maximum length with an ellipsis, optionally at a whole word.

Text Cleanup Runs in your browser

Trim and Shorten Your Text

Every character you type is stripped from the start and end of each line.
Counts towards the maximum length. Leave empty for none.

How to Use the Text Trimmer

  1. Paste your text into the box.
  2. Pick the trimming options: whole text, each line, blank lines at the ends, and any special characters to remove from line edges.
  3. To shorten the text enter a maximum length, choose whether it applies to the whole text or each line, and set the ellipsis.
  4. Check the before and after size and copy or download the result.

About This Tool

Developers and editors cleaning pasted data, writers shortening snippets for previews, and anyone who needs text to fit a field without losing whole words.

Input: Plain text  ·  Output: Trimmed text.

Features and Limitations

Features

  • Separate control of the whole text, line starts and line ends.
  • Strips any characters you choose, such as - * # > from line edges.
  • Truncates by visible characters, so emoji are never cut in half; the ellipsis counts towards the limit.
  • Optional cut at a whole word.

Limitations

  • Only the ends of lines are trimmed; spaces inside a line are untouched (use Remove Extra Spaces for that).
  • The characters option removes any listed character repeatedly from the edges, so “-*” removes both dashes and asterisks.
  • The maximum length counts visible characters, not bytes.
  • If the maximum is no larger than the ellipsis, the ellipsis is left out and the text is simply cut at the maximum.
  • Results are computed in your browser; nothing you enter is sent to a server.

Example

With a maximum length of 10 and the default ellipsis, “The quick brown fox” becomes “The quick…” (9 characters plus the ellipsis). With a maximum of 12 the plain cut gives “The quick b…”, while “Cut at a whole word” gives “The quick…”.

Frequently Asked Questions

What is the difference between trimming the text and trimming each line?

Trimming the text removes whitespace only at the very beginning and end. Trimming each line also removes spaces at the edges of every line in the middle of the text.

Does the ellipsis count towards the maximum length?

Yes. A maximum of 10 with a one-character ellipsis keeps 9 characters of your text plus the ellipsis, so the total is 10.

Will it cut an emoji in half?

No. Truncation counts visible characters (grapheme clusters), so emoji and accented letters stay whole.

How can I remove bullet characters?

Type them in Also trim these characters, for example -*•, and each line loses them at both ends along with the spaces around them.

Related Tools

More like this: all Text Cleanup tools, all Text & Writing tools or the TinySandy home page.