Text Truncator

Truncate any text to a specific character or word limit with a custom ellipsis. Ideal for meta descriptions, social previews, and dynamic text fields.

Input Text
Limit by
Max limit
Ellipsis

Frequently Asked Questions

Google typically displays meta descriptions up to 155–160 characters. Descriptions longer than this are truncated in search results. Best practice: write 130–155 characters to ensure the description fits across different devices.
Common limits: X/Twitter: 280 characters; Facebook feed posts: ~500 before "See More"; Instagram: 2,200 characters; LinkedIn posts: 3,000 characters. For Open Graph previews, keep titles under 60 chars and descriptions under 160 chars.
Character truncation stops at exactly N characters (respecting word boundaries if enabled), counting every letter, space, and punctuation mark. Word truncation stops after N complete words, regardless of total character length.
With this option enabled, the tool truncates at the last complete word that fits within the limit, rather than cutting mid-word. For example at 20 characters: "Hello wonderful world" → "Hello wonderful…" (word boundary) vs "Hello wonderful wor…" (hard cut).
The single ellipsis character (…, U+2026) is preferred over three dots .... The ellipsis character counts as 1 character in limits, renders correctly in all modern fonts, and avoids line-break issues that can split three dots across two lines.
PHP: mb_substr($text, 0, 160) for multi-byte safe truncation. JavaScript: text.slice(0, 160); text.split(' ').slice(0, n).join(' ') for words. Python: text[:160]; ' '.join(text.split()[:n]) for words.
Database columns with fixed VARCHAR limits require application-level truncation before insert. Truncating at the database level (e.g., MySQL's silent truncation) loses data without warning. Always truncate in the application before storing.
X/Twitter allows 280 characters per post. URLs are always counted as exactly 23 characters regardless of length (via t.co wrapping). Emoji count as 2 characters each (UTF-16 code units). Images and media do not consume the character limit.
This tool counts characters using JavaScript's native string length (UTF-16 code units). For most text (ASCII, European characters, CJK), this equals the number of visible characters. Emoji and some rare Unicode characters use 2 code units each — matching how most databases and APIs count string length.
Most email clients display 40–60 characters in the inbox preview. Gmail shows roughly 70 on desktop; mobile clients show 30-40. Best practice: keep email subjects under 50 characters to ensure they display fully across most clients.

About This Text Truncator

This free text truncator shortens text to a specified character or word limit with a customisable ellipsis. Includes a usage progress bar with colour coding and word-boundary-aware truncation to avoid mid-word cuts.

When to use this tool

  • Generating truncated meta descriptions within 155-character SEO limits
  • Shortening Open Graph titles and descriptions for social sharing
  • Testing how database VARCHAR fields handle long user input
  • Creating consistent-length text excerpts for card UIs

Standards & References

Related Articles

In-depth guides and technical articles.

View all →
CSS text-overflow: ellipsis Doesn't Remove Text — The Four Truncation Layers and MySQL's Silent Data Loss Bug
CSS text-overflow: ellipsis hides text from view but leaves it in the DOM — search engines index it, screen readers may announce it, and Find in Page finds it. That's correct for display truncation but completely wrong for data-level truncation. Here's the four truncation layers (CSS, JavaScript, API, database) and when each is correct, MySQL's silent truncation that discards characters without error in default mode, and why meta description truncation should use word boundaries rather than character counts.
CSS text-overflow: ellipsis Hides Text — It Doesn't Remove It: When to Truncate at Display vs Data Layer
CSS text-overflow: ellipsis hides overflowing text but leaves the full content in the DOM — search engines read it, screen readers may announce it, and selecting the text copies the full string. Server-side truncation actually shortens the content before it reaches the client. Here's when each is appropriate, multi-line -webkit-line-clamp, the semantically superior details/summary alternative, and why meta descriptions should be written for readability not display-limit truncation.
Why Truncating Text at "Exactly 100 Characters" Is Harder Than It Looks: UTF-8, Word Boundaries, and HTML
Truncating at exactly 100 characters sounds simple — until you're splitting a multibyte UTF-8 sequence and producing invalid text, cutting mid-word and leaving "fo" dangling, or cutting HTML and leaving unclosed tags. Here's the byte vs code point vs grapheme cluster distinction, the word-boundary backtracking algorithm, why HTML truncation requires an actual parser (not string slicing), and why your ellipsis length has to come out of the character budget before you cut.
Pagination, Infinite Scroll, or "Read More": Three Answers to "This Content Is Too Long" and When Each Fits
"Read more" links, pagination, and infinite scroll are three different answers to "content is longer than the space available" — each with different SEO, accessibility, and UX trade-offs. Here's where each fits best, why infinite scroll's footer-reachability problem is well-documented, and how hybrid approaches (load-more buttons, infinite scroll with History-API pagination underneath) combine their benefits.
Truncation Bugs: Database VARCHAR Silent Data Loss, CSS Overflow, and Windows Path Length Limits
MySQL silently truncates strings that exceed VARCHAR column lengths — no error, just missing data. Here's database silent truncation, CSS text-overflow and multi-line clamping, the accessibility problem with truncated UI text, API response truncation flags, and the Windows 260-character path length problem.