Truncate Text
Trim text to a character, word, line, sentence, or byte limit instantly.
Updated
What is the Truncate Text?
Truncate Text is a free, instant tool for trimming any piece of text down to a precise character, word, line, sentence, or byte limit — right in your browser, with no data ever leaving your device.
Whether you're preparing a meta description that must stay under 160 characters, capping a tweet at 280 characters, enforcing a word count limit on user-generated content, or shortening dozens of product titles at once, this tool handles it in seconds.
Paste your text, set your limit, choose your truncation mode and ellipsis style, and the result appears instantly. Need to process a whole list? Switch to Batch mode and truncate hundreds of lines at once, then copy the entire output with one click.
Key capabilities at a glance:
- 5 truncation modes — characters, words, lines, sentences, UTF-8 bytes
- 3 truncation positions — end, start, or middle (great for file paths and URLs)
- Smart word-boundary protection — never cuts a word in half
- Custom ellipsis — choose
…,...,[more],[read more], or your own suffix - HTML stripping — safely truncate rich-text or CMS content
- Batch mode — truncate one item per line, get a full results table and copy-ready output
- Live counter — see your character/word/byte count update as you type
- Diff preview — shows exactly what was removed and what was kept
How it works
Truncate Text runs entirely in your browser using pure client-side logic. There is no server, no upload, and no waiting — results appear the moment you start typing.
Step 1 — Choose your truncation mode
Select how you want to measure the limit:
| Mode | What it counts |
|---|---|
| Characters | Every Unicode code point (emoji count as 1) |
| Words | Whitespace-separated tokens |
| Lines | Newline-separated rows |
| Sentences | Runs ending in ., !, or ? |
| Bytes | UTF-8 encoded byte length |
Use Characters for most UI and social-media use cases. Use Bytes when interfacing with APIs or databases that enforce a byte-length constraint (common in MySQL, Redis, and SMS gateways).
Step 2 — Set your limit
Type any positive whole number or click a quick-limit preset: 50, 100, 140, 160 (SMS), 200, 280 (tweet), or 500. The live counter beneath the input field instantly shows your current count and what percentage of the limit you have used, turning red if you go over.
Step 3 — Configure position and ellipsis
Truncation position controls where the cut happens:
- End — keeps the beginning, appends an ellipsis (the classic approach)
- Start — keeps the end, prepends an ellipsis (useful for log tails or file paths)
- Middle — keeps both the opening and closing text, inserts the ellipsis in the center (ideal for URLs and long identifiers)
Ellipsis / suffix lets you choose what is appended or inserted at the cut point. Options include the typographic ellipsis character …, three dots ..., [more], [read more], (truncated), a hard cut (no suffix), or any fully custom string you define.
Step 4 — Apply optional settings
- Don't cut mid-word (character mode only) — the tool walks back to the nearest word boundary so the output never ends mid-word.
- Strip HTML tags first — removes all HTML markup and decodes common entities before truncating, so your character count reflects visible text, not tag syntax.
Step 5 — Read your results
Once text is in the input, the truncated output appears immediately below. Four stat tiles show:
- Original count
- Count after truncation
- How many units were removed
- Whether truncation actually occurred (a "Fits as-is" notice means no cut was needed)
Click Show diff / what was removed to open a color-coded preview: the kept portion is shown normally, the ellipsis is highlighted in blue, and the removed text is displayed with a red strikethrough.
Batch mode
Switch to the Batch tab and paste one item per line. Every line is truncated independently using the same settings. A results table shows each original vs. truncated pair with per-row counts and a Trimmed / OK status badge. A bulk output textarea at the bottom contains all truncated lines ready to copy in one click.
Accuracy and edge cases
- Unicode-safe — the character counter uses JavaScript's spread iterator (
[...text].length), which correctly counts emoji and supplementary-plane characters as 1, unlikeString.lengthwhich counts surrogate pairs as 2. - Byte-accurate — the byte counter manually walks the string using UTF-8 encoding rules, including 4-byte surrogate pairs.
- Empty input — treated gracefully; no error is shown until you start typing.
- Text already within limit — the tool detects this and shows a success notice instead of a truncated output, so you never accidentally add an ellipsis to text that did not need it.
Examples
Shorten a blog post excerpt to 160 characters
Truncate a long article introduction to fit a meta description or preview card, preserving whole words.
Limit a product title to 10 words
Trim a verbose product name down to 10 words for a clean e-commerce listing.
Truncate a URL path in the middle
Use middle truncation to shorten a long file path while keeping both the beginning and end visible.
Batch truncate tweet-sized text at 280 characters
Paste multiple social media posts and trim each one to the 280-character Twitter/X limit in one pass.
Frequently asked questions
What does "truncate text" mean?
What does "truncate text" mean?
Truncating text means cutting it short at a defined limit — a maximum number of characters, words, lines, sentences, or bytes — and optionally appending a suffix like … to signal that the content continues. It is widely used in UI development, SEO, content management, and API integrations where field-length constraints must be enforced.
What is the difference between truncating by characters vs. bytes?
What is the difference between truncating by characters vs. bytes?
Characters count visible symbols — each letter, digit, emoji, or punctuation mark is 1 character regardless of how many bytes it occupies. Bytes count the raw UTF-8 encoded size. ASCII characters (a–z, 0–9) take 1 byte each, most Western accented characters take 2 bytes, most CJK characters (Chinese, Japanese, Korean) take 3 bytes, and emoji typically take 4 bytes. Use character mode for most UI text; use byte mode when a database column, API field, or SMS gateway enforces a byte-length limit.
Why should I use "Don't cut mid-word"?
Why should I use "Don't cut mid-word"?
When truncating by characters, a hard cut can split a word — for example, cutting "remarkable" at 7 characters gives "remarka…" instead of "remark…". Enabling this option walks back to the nearest space before the cut point, so the output always ends on a complete word. It uses slightly fewer characters than the limit allows but produces much more readable results.
How does middle truncation work, and when should I use it?
How does middle truncation work, and when should I use it?
Middle truncation keeps text from both the beginning and the end of the string, placing the ellipsis in the center. For example, a 20-character middle truncation of /usr/local/bin/my-very-long-script.sh might produce /usr/local…script.sh. This is most useful for file paths, URLs, and identifiers where both the root and the file extension (or final segment) need to remain visible.
Can I truncate text that contains HTML?
Can I truncate text that contains HTML?
Yes. Enable the Strip HTML tags first option and the tool will remove all HTML tags and decode common entities (&, , <, etc.) before applying the limit. This ensures that your character or word count reflects the visible text a user would read, not the underlying markup. The output will be plain text, not HTML.
How do I truncate multiple texts at once?
How do I truncate multiple texts at once?
Switch to the Batch tab. Paste one item per line — each line is treated as a separate text and truncated independently using the same mode, limit, position, and ellipsis settings. The results table shows every original/truncated pair side by side with counts and a status badge. The output textarea at the bottom contains all truncated results, one per line, ready to copy in a single click.
What ellipsis or suffix options are available?
What ellipsis or suffix options are available?
You can choose from the typographic ellipsis character … (a single Unicode character, U+2026), three separate dots ..., [more], [read more], (truncated), or a hard cut with no suffix at all. There is also a Custom option where you can type any string — useful for suffixes like — read more, →, or a localized equivalent in another language. The ellipsis length is counted against your limit, so the kept text is always short enough that the full output (text + suffix) does not exceed it.
Does the tool count emoji correctly?
Does the tool count emoji correctly?
Yes. The character counter uses JavaScript's iterable spread ([...text].length) which correctly iterates over Unicode code points. This means a single emoji — even a complex one like a family emoji that uses multiple code points — is counted at the code-point level. Most standard emoji count as 1 character. Composite emoji (skin-tone modifiers, ZWJ sequences like 👨👩👧) may count as more because they are composed of multiple code points joined by zero-width joiners, which is consistent with how platforms like Twitter count them.
Is my text sent to any server?
Is my text sent to any server?
No. All processing happens entirely in your browser using client-side JavaScript. Your text is never uploaded, logged, or transmitted anywhere. You can use this tool on sensitive drafts, private documents, or confidential content without any privacy concern.
What is the maximum text length the tool can handle?
What is the maximum text length the tool can handle?
The tool accepts texts up to tens of thousands of characters with no performance issues. The limit field accepts values up to 10,000,000 units. For extremely large inputs (millions of characters), processing remains instant because all logic runs synchronously in a single pass with no external dependencies.
How is this tool useful for SEO?
How is this tool useful for SEO?
Search engines display meta descriptions at roughly 155–160 characters and page titles at roughly 50–60 characters. Paste your draft meta description or title tag into the tool, set the limit to 160 or 60 characters respectively, and enable word-boundary protection to get a clean, search-engine-friendly snippet. The live counter lets you see exactly where you stand as you edit without switching between tools.
Can I use this to enforce Twitter or LinkedIn character limits?
Can I use this to enforce Twitter or LinkedIn character limits?
Yes. Twitter/X enforces a 280-character limit per post. LinkedIn posts support up to 3,000 characters, but previews are often truncated at 210 characters. Use the quick-limit preset buttons (280 is included) or type any custom limit. Paste your draft post, check the live counter, and copy the truncated version instantly. Batch mode is particularly useful if you are preparing multiple posts at once.
What happens if my text is already within the limit?
What happens if my text is already within the limit?
The tool detects this and shows a green success notice — "Your text already fits within the X limit — no truncation needed" — instead of a truncated output. No ellipsis is added and the original text is left unchanged. This prevents accidentally shortening or appending a suffix to text that was already the right length.
Related tools
More utilities you might find handy.
Anagram Checker
Check if two strings are anagrams with customizable normalization options.
Case Converter
Convert text to various cases like uppercase, lowercase, title case, camelCase, snake_case, and more, with additional text cleaning features.
Find & Replace Tool
Find and replace text instantly online with regex, whole word, case matching, preserve case, and batch rules. 100% client-side.