Truncate text to a specified length with ellipsis. Free online text truncator for shortening text to exact character or word limits.
The text truncator shortens your text to a specified maximum length, either by character count or word count. When text exceeds the limit, it is cut off and an ellipsis (...) is appended to indicate that content has been removed. This is essential for UI design (showing previews), meta descriptions (character limits), social media posts, and anywhere space is limited.
Truncated = Text.substring(0, maxLength) + (Text.length > maxLength ? "..." : "")If the text length exceeds the specified maximum, the first maxLength characters are kept and "..." is appended. If the text is already within the limit, it remains unchanged. Word-based truncation counts words instead of characters and avoids cutting words in half.
| Input | Output |
|---|---|
| "This is a long sentence" → 10 chars | This is a ... |
| "Short text" → 20 chars | Short text (no change — under limit) |
| "One two three four five" → 3 words | One two three... |