What Truncate Text helps you do
Cut text to a maximum character count and optionally append an ellipsis or another suffix. This is the pattern behind summaries, previews and meta descriptions that must fit a hard character budget. The whole input is treated as one string rather than line by line.
Truncation runs in your browser. No text is sent to Haivix servers.
How it works
Line tools split the pasted text into lines, apply one operation to the list, and rejoin it with a newline. A blank line is still a line, so it participates in sorting, numbering and shuffling unless you remove it first. The transformation runs in the browser and keeps the existing line order except where the tool's purpose is to change it. Nothing is uploaded, and the output replaces the preview rather than the source. If the input ends with a newline, the final empty line can affect a count or a shuffle; trim the input first when that matters.
How to use Truncate Text
- Paste the text and set the maximum number of characters.
- Add an optional suffix such as three dots.
- Truncate and check the length of the result.
- Copy the shortened text.
When to use it
- Fit a title or description into a character-limited field.
- Create a short preview from a long paragraph.
- Prepare text for a card or list where overflow would break the layout.
- Cut a meta description to a target length.
- Create an excerpt for a notification or summary.
- Trim a long value before pasting it into a form.
When not to use it
- Do not use it when the cut must fall on a word boundary; it slices characters.
- Do not use it on structured data where the cut could remove a closing tag or quote.
- Do not expect it to preserve whole sentences.
Example
Truncating a 200-character paragraph to 50 characters keeps the first 50 and, if you enable it, replaces the cut with an ellipsis. The suffix counts toward the limit, so the visible text is slightly shorter than the maximum. Text already under the limit is returned unchanged.
What you can do with Truncate Text
- Truncate to a maximum character count.
- Append an ellipsis or another custom suffix.
- Include the suffix inside the character budget.
- Leave text shorter than the limit unchanged.
- Copy the shortened result.
- Run the truncation locally with no upload.
Example: check the line structure first
Paste a small sample and note how many lines it has, including blank lines and a possible trailing newline. The count explains most surprises after sorting, numbering or filtering.
Apply the operation and compare the first and last lines with the source. If the structure is right, run the full text; if not, remove the blank lines or trim the input first.
Copy or download the result and keep the original until the destination accepts it. Line tools are one-way, so the source is the only undo.
For a list pasted from a spreadsheet, check for hidden carriage returns or wrapping quotes before transforming it. A stray quote can sort differently or survive a filter that looks correct at a glance.
When the result feeds another tool, run a second pass only after confirming the first. Chaining a sort and a deduplication is safe, but chaining two numbering steps produces duplicated prefixes.
If the output is going into a version-controlled file, check the diff before committing. A blank-line or line-ending change can look like a content change in review even when the words are unchanged.
What to know before you start
- It cuts at characters, not words, so a word can be split mid-way unless you trim at a boundary yourself.
- The suffix may or may not count toward the limit depending on the option you set; here it is included.
- The whole text is treated as one string, not per line.
- There is no sentence-aware or HTML-aware truncation.
Common mistakes
- Forgetting that the suffix counts toward the maximum.
- Cutting in the middle of a word or a URL.
- Assuming the tool truncates each line separately.
- Applying it to markup and removing a closing tag.
Troubleshooting
If the result is longer than expected, the suffix may not be counted by your own check; the tool includes it in the budget.
If a word is cut, that is expected; trim at a space beforehand or edit the result.
If the text is unchanged, it was already within the limit.
If a suffix disappears, it may be longer than the maximum and was truncated itself.
Related standards and documentation
- A newline is a single line separator in Unix text; Windows files may use CRLF.
- Modern JavaScript sorts are stable, so equal lines keep their relative order.
- Blank lines are entries, not separators, in these transformations.
- A trailing newline is a text convention, not content; remove it before counting lines.
- Count the lines before you transform.
- Remove blanks first when they should not participate.
- Keep the original until the result is accepted.
- Check the last line for a trailing newline.