Language
English English Vietnamese (Tiếng Việt) Vietnamese (Tiếng Việt) Chinese (简体中文) Chinese (简体中文) Portuguese (Brazil) (Português do Brasil) Portuguese (Brazil) (Português do Brasil) Spanish (Español) Spanish (Español) Indonesian (Bahasa Indonesia) Indonesian (Bahasa Indonesia)
Truncate Text

Truncate Text

Shorten text to an exact length by characters, words, or lines, or cut at a stop character. Keep whole words and add a custom suffix.

Truncate Text to a Precise Length

Truncate text online to cut a string down to an exact length by characters, words, or lines, or to stop at a specific character. Paste your text on the left and the shortened result appears instantly on the right — no setup, nothing to install.

Unlike a plain counter, this tool gives you four cutting modes plus a Preserve Words option so words are never sliced in half, and a custom Suffix (like ...) that is added only when text is actually cut. It is built for developers fitting data into database fields, content creators making consistent excerpts, and anyone testing how a layout handles long versus short text.

Private by design: all truncation runs in your browser with JavaScript. Your text is never uploaded, stored, or analyzed — it stays on your device.

How to Truncate Text

1

Add your text

Paste or type into the Input Text panel on the left. Plain text, code snippets, and multi-line content all work.

2

Pick a mode

Choose Chars, Words, By Char, or Lines from the mode buttons to decide how the text is cut.

3

Set the limit and options

Enter a numeric Limit (or a Stop Char in By Char mode), type a Suffix such as ..., and turn on Preserve Words if you want whole words only.

4

Review and copy

The shortened text shows in the Result panel, with Original and Truncated counts in the status bar. Edit the result directly if needed, then click copy.

Features

Character Mode (Chars)

Cut text at an exact character count — the most precise mode for strict limits like database fields, meta descriptions, or short bios.

Word Mode (Words)

Keep a set number of words so sentences stay readable — ideal for blog excerpts, article previews, and summaries.

Line Mode (Lines)

Keep only the first N lines, respecting line breaks — great for code previews, log snippets, and multi-line displays.

Stop Character Mode (By Char)

Cut at the first occurrence of a character you define, such as . or | — perfect for extracting a name from a formatted string.

Preserve Words

In Chars mode, this backs up to the nearest space before your limit so words are never split mid-word, while still staying within the limit.

Custom Suffix

Append any marker — ..., [Read more], an arrow, or nothing at all. The suffix is added only when the text is actually truncated.

Real-Time Processing

The result updates instantly as you type or change any setting, with live Original and Truncated counts in the status bar.

Editable Output

The Result panel stays editable, so you can fine-tune the truncated text by hand before you copy it.

Paste, Copy & Clear

One-click buttons let you paste from the clipboard, copy the result, and clear the input to start over.

Remembered Settings

Your mode, limit, suffix, stop character, and Preserve Words choice are saved in your browser for the next time you visit.

Frequently Asked Questions

How do I truncate text to a number of characters?

Select Chars mode, enter your character count in the Limit field, and the Result panel shows the text cut to that exact length. Anything beyond the limit is removed.

Can I truncate by words instead of characters?

Yes. Switch to Words mode and set the Limit to the number of words to keep. Words are counted by the spaces between them, which keeps short summaries readable instead of fitting an exact byte count.

How do I keep whole words when truncating?

Turn on Preserve Words in Chars mode. Instead of cutting mid-word, the tool backs up to the nearest space before your limit, so the result always ends on a complete word and never exceeds the limit you set.

How do I add "..." (an ellipsis) at the cut point?

Type the marker you want into the Suffix field — ... is the default. It is appended only when the text is actually shortened, so unchanged text stays clean. Note that the suffix counts toward the displayed Truncated length, so leave room for it in your limit if you need a strict final size.

Can I truncate text by lines?

Yes. Use Lines mode and set the Limit to the number of lines to keep. Line breaks are respected, which is handy for code previews, log snippets, and "see more" line limits.

What does By Char mode do if the character is not found?

By Char mode cuts everything from the first occurrence of your Stop Char onward, keeping the part before it. If the character is not present in the text, the original text is returned unchanged, which prevents accidental data loss.

Does it handle Unicode, emoji, and other languages?

Yes. The tool works with Unicode text including Vietnamese, Chinese, Japanese, emoji, and special symbols, so you can truncate content in any language.

Is the truncation done in my browser?

Yes. All processing happens locally in your browser with JavaScript — your text is never sent to a server. That makes it safe for confidential content. Your input is not saved between sessions, so copy the result before you leave the page.

Mode
Limit
Suffix
Input Text
Result
Original: 0
Truncated: 0
Choose Mode to cut by characters, words, lines, or a stop character
Enable Preserve Words to avoid cutting words in half
Use By Char mode to cut at a character like . or |
Add a Suffix like ... to mark truncated text
Edit the Result directly to fine-tune the output
All processing happens locally - your text never leaves your device
Want to learn more? Read documentation →
1/7
Start typing to search...
Searching...
No results found
Try searching with different keywords