Text Truncator / Excerpt Generator

Paste text, set a limit, and the excerpt updates as you go.

How it works

In Characters mode, text at or under the limit is returned unchanged. Longer text is cut at the limit, then backed up to the last whitespace boundary at or before that point — so it never slices a word in half — trailing whitespace is trimmed, and an ellipsis (…) is appended. If the whole prefix up to the limit has no whitespace at all (one very long unbroken word), it falls back to a hard cut at the limit rather than refusing to shorten it. In Words mode, text with that many words or fewer is unchanged; otherwise the first N words are kept, joined by a single space, with an ellipsis appended.

Frequently asked questions

Why does this back up to a word boundary instead of cutting mid-word?

A hard cut at exactly N characters will, more often than not, slice a word in half — "…the quick br" reads as broken, not as intentionally shortened. Backing up to the last whitespace at or before the cut means the excerpt always ends on a whole word, at the cost of occasionally landing a few characters short of the limit.

When should I use word-count mode instead of character-count mode?

Character limits are the right measure when the destination itself is character-limited — a meta description, a tweet-style preview, a card that truncates at a fixed width. Word count is the better fit when the convention is phrased in words, like an excerpt defined as "the first 50 words" of an article, independent of how long those words happen to be.

What happens if my text is already shorter than the limit?

It is returned exactly as given — truncated is false, and no ellipsis is added. An ellipsis only ever means "there was more text here that got cut off," so it would be misleading to add one to text that was never shortened.