Clean Text · browser-local

Text Length Limiter

Cut text down to a hard length limit for a bio, meta description, or byte-capped field. GlyphSift measures in graphemes, code points, or UTF-8 bytes, always keeps whole characters instead of splitting an emoji, and can add an ellipsis whose own length is counted against the budget. It only trims and reports — it never summarises or rewrites.

Works on up to 5,000 characters and 20,000 code points per field (at most 64 code points per character), processed in your browser.

75 graphemes75 code points75 bytes
Length limit

Original 75 · result 75 graphemes. Within the limit — nothing removed.

Live result

Output

This bio is a little too long for a 280 character limit and needs trimming.

Good fit

Use this tool when

  • A field has a strict character or byte limit.
  • You need to keep emoji and combined characters intact when cutting.
  • You want the ellipsis included in the length budget, not added on top.

Keep the original

Avoid it when

  • You want a summary or reworded shorter version.
  • You need to trim by words or sentences rather than length.
  • The destination counts length in a unit not offered here.
01

Reviewed truth vectors

Examples that expose the edge cases

Inputabcdefg (limit 5 graphemes, ellipsis on)
Outputabcd…

Four characters plus the ellipsis fill the 5-grapheme budget.

InputHi 👨‍👩‍👧‍👦 there (limit 4 graphemes)
OutputHi 👨‍👩‍👧‍👦

The family emoji is one grapheme and is kept whole, not split.

Inputcafé (limit 4 bytes)
Outputcaf

é is two UTF-8 bytes, so it is dropped to stay within four bytes.

02

Transparent implementation

How it works

  1. 01

    Measure the text in the chosen unit — graphemes, code points, or UTF-8 bytes.

  2. 02

    If an ellipsis is enabled, subtract its length from the budget first.

  3. 03

    Add whole graphemes until the next one would exceed the budget, then report the used and total counts.

03

Known limitations

What the result cannot promise

Trimming is by length, not by words or sentences.

A byte or code-point limit smaller than one character can yield only the ellipsis or an empty result.

It measures the units shown here; a destination may count length differently.

04

Questions before copying

Frequently asked questions

Does the ellipsis count toward the limit?

Yes. When the ellipsis is on, its length in the chosen unit is subtracted from the budget first, so the final result including the ellipsis stays within the limit.

Will it cut an emoji in half?

No. It adds whole graphemes only, so an emoji or combined character is either kept complete or left out — never split into broken pieces.

Which unit should I use?

Use graphemes for what a reader sees, code points for many API limits, and UTF-8 bytes for storage or protocol fields that cap raw bytes.

05

Testing and sources

How this tool is tested

GlyphSift Editorial — Text-engine notes written and reviewed by Hommer Zhao, Founder & General Manager

GlyphSift Editorial is the site's writing and review process, led by Hommer Zhao, who is accountable for every tool page and correction. Each tool's examples are written against real Unicode edge cases and checked against the engine before the page is published.

Each tool page is reviewed against the same six input classes the engine is tested with — ASCII, emoji, combining marks, non-Latin scripts, empty input, and 5,000-grapheme input — and cannot become eligible if it is only a parameter variation of another page.

Automated evidence

  • Tool-contract & coverage suiteShared suite · 37 cases across all tools it covers

    tests/tools-30.test.mjs mirrors the ToolRunner dispatch and asserts every registered engineId returns the contracted output shape, plus a coverage guard: every style keeps one output character per input character with unmapped characters passed through in place, and strikethrough, zalgo and upside-down never drop or split a grapheme cluster.

    Run in: node --test after a production build (vinext build)
  • Rendered-HTML suiteShared suite · 26 cases across all tools it covers

    tests/rendered-html.test.mjs renders the deployed server bundle and asserts the Unicode-version manifest and each wave's tool markup are present in the server-rendered HTML.

    Run in: node --test against the built dist/server bundle
  • Transform & cleanup suiteShared suite · 38 cases across all tools it covers

    tests/transform-cleanup.test.mjs exercises each deterministic cleanup and transform action against whitespace, duplicate, ordering, casing, and HTML-to-text edge cases.

    Run in: node --test, no network, no randomness

Standards this tool follows