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.
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.
Reviewed truth vectors
Examples that expose the edge cases
abcdefg (limit 5 graphemes, ellipsis on)abcd…Four characters plus the ellipsis fill the 5-grapheme budget.
Hi 👨👩👧👦 there (limit 4 graphemes)Hi 👨👩👧👦The family emoji is one grapheme and is kept whole, not split.
café (limit 4 bytes)café is two UTF-8 bytes, so it is dropped to stay within four bytes.
Transparent implementation
How it works
- 01
Measure the text in the chosen unit — graphemes, code points, or UTF-8 bytes.
- 02
If an ellipsis is enabled, subtract its length from the budget first.
- 03
Add whole graphemes until the next one would exceed the budget, then report the used and total counts.
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.
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.
Testing and sources
How this tool is tested
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
- UAX #29: Unicode Text Segmentation
Grapheme and word boundaries underpinning line and whitespace operations.
- UAX #14: Unicode Line Breaking Algorithm
Line-break semantics behind hard-wrap repair.