Truncate Text

Cut text to an exact length, by characters or whole words.

Options

Max characters or words to keep. 0 removes everything, up to 1,000,000.

Mode

Appended only when text was cut. Empty means no marker.

The result updates as you type. Ctrl + Enter truncates now.

Truncated text

How to truncate text

Paste your text into Your text, or press Load example. Set the Length, pick Characters or Words, and optionally type an Ellipsis such as …. The cut result appears next to it and updates as you type. Copy the result or download it as a .txt file. Everything runs in your browser, so nothing you paste is uploaded.

Examples

InputOutput
hello world (5 chars) hello
hello brave world (2 words) hello brave
hello brave world + … (2 words) hello brave…

Limits and edge cases

  • Counting is code-point aware, so emoji count once and are never split in half.
  • The ellipsis is appended only when text was actually cut, and it counts toward the output length.
  • Words mode keeps whole words and collapses runs of whitespace to single spaces in the output.
  • Length 0 removes everything, leaving an empty result or just the ellipsis when one is set.
  • Text that already fits is returned unchanged with no ellipsis added.

Frequently asked questions

How do I truncate text?

Paste your text, set the length and choose characters or words. The cut result appears instantly and updates as you type.

What is the difference between characters and words mode?

Characters mode keeps the first N characters exactly. Words mode keeps the first N whole words, so no word is cut in half.

How does the ellipsis work?

Type any marker such as … or ... and it is appended only when text was actually cut. If your text already fits, nothing is added.

What happens if my text is shorter than the length?

Nothing is cut. The output is identical to the input and the tool reports that the text already fits.

What does length 0 do?

Length 0 removes everything, so the output is empty, or just your ellipsis marker if you set one.

Is my text uploaded anywhere?

No. Truncation runs in your browser with JavaScript and nothing is sent to a server. Inputs under 200 KB are kept in your browser's local storage so they are still there when you come back.