String Truncate
Truncate strings to a specified length with optional ellipsis. Supports word-boundary and line-by-line modes. 100% browser-based, privacy-first.
How does string truncation work?
The tool cuts your input text to a specified character count. If the original text exceeds the limit, the excess is removed and an optional indicator (like '...') can be appended to signal that content was trimmed.
What is word-boundary truncation?
Word-boundary mode ensures the cut happens at a space between words rather than in the middle of one, producing cleaner output that remains readable.
What does line-by-line mode do?
In line-by-line mode, every line of your input is truncated independently to the same maximum length. This is ideal for processing lists, logs, CSV data, or any multi-line content where uniform line length matters.
Can I customize the ellipsis indicator?
Yes. You can set any string as the truncation suffix — common choices are '...', '…', '[more]', '→', or leave it empty for no indicator at all.
Does the tool count emojis and unicode correctly?
Yes. The tool counts by JavaScript string length (UTF-16 code units). Most characters including emojis count as expected, though some complex emoji sequences may count as more than one unit.
Is my data sent to a server?
No. All processing happens locally in your browser using JavaScript. Your text never leaves your device, making it safe for sensitive content.
Can I truncate very large texts?
Yes. Since processing is client-side, it handles large texts well. For extremely large inputs (hundreds of MB), performance depends on your browser and device memory.
What are common use cases?
Typical uses include: preparing text for database fields with length limits, generating SEO meta descriptions within character limits, formatting data for display in UI components, truncating log lines, and creating text previews.
Can I reverse a truncation?
No. Truncation permanently removes characters beyond the limit. Always keep a copy of your original text before truncating if you may need the full content later.
Does it work offline?
Yes. Once the page is loaded, the tool works entirely offline without any network connection.