Text Trimmer

Trim whitespace from the ends of each line, or cut text to a hard character limit, 150 for an Instagram bio, 158 for a meta description.

Two different kinds of trimming

Trimming ends means removing the whitespace around each line. The indentation carried over from a quoted email, the trailing spaces left by a wrapped paste. Trimming to a limit means cutting the whole block down to a maximum character count, which is a different job entirely. The limit modes exist because so many fields have hard caps that are enforced silently: 150 characters for an Instagram bio, roughly 158 before a meta description is truncated in search results, 280 for a post. Going over does not usually produce an error. It produces a sentence that stops mid-word in public.

Cutting at the right place

When the ellipsis option is on, the cut reserves a character for the ellipsis itself so the total still lands inside your limit, and trailing whitespace is removed before it is appended, otherwise you get a space sitting awkwardly before the dots. Counting is done by code point rather than by UTF-16 unit, which matters the moment an emoji is involved: a single emoji can occupy two UTF-16 units, and a naive cut can slice one in half and leave a broken character at the end of your bio.

Frequently asked questions

Does the ellipsis count toward my limit?

Yes. The cut reserves a character for it, so a 150-character limit with the ellipsis on gives you 149 characters of text plus the ellipsis.

Will it cut a word in half?

Yes. The limit is enforced on characters, not word boundaries. Trailing whitespace is trimmed before the ellipsis is added, but a mid-word cut is possible.

Is an emoji one character?

It is counted as one code point here, so the cut will not split it. Some platforms count the same emoji as two toward their own limit, so leave a little headroom.