How to trim lines to max length
Set a character limit for each line, then inspect the shortened text. Paste content into Input text or load a text file with Upload text. The tool processes lines separately, so each input line produces one output line. You can add an ellipsis to lines that exceed the limit, and the mark counts within that limit.
- Paste text into
Input text, or chooseUpload textto load a text file. - Enter a whole number in
Maximum characters per line. The field accepts1through50and starts at3. - Select
Add an ellipsis when a line is trimmedto mark lines that are shortened. - Read
Trimmed output, then chooseCopy trimmed textorDownload trimmed text.
What maximum characters per line changes
The number applies to each line separately. Lines at or below the limit pass through unchanged. Longer lines are cut at the character position, even inside a word, and the removed characters do not appear in Trimmed output.
Input:
This line is longer than ten characters
Short
Maximum characters per line: 3
Output:
Thi
Sho
Input text and Trimmed output are separate areas. Change the limit or the ellipsis setting to recalculate the result while the original text stays in the input area.
How the ellipsis option affects truncation
Select Add an ellipsis when a line is trimmed to mark a shortened line. The ellipsis takes space inside Maximum characters per line, so the result stays within the selected maximum. Lines already within the limit keep their original text.
Maximum characters per line accepts whole numbers from 1 to 50. Decimal values are reduced to a whole number before processing. Blank lines remain blank, and shorter lines are not padded to match longer ones.
Where trimming lines to a limit comes up
- Set a small limit when a text panel can show only a fixed number of characters per line.
- Prepare a text preview by limiting pasted copy while keeping one output line for each input line.
- Load a text file with
Upload text, inspect the shortened lines, and save the result withDownload trimmed text.
When another text cleanup tool fits better
Use Text Cleanup & Filter Tools for a different text task. Choose Trim Whitespace to remove leading or trailing spaces. Choose Remove Lines Containing Specific Words to remove matching lines. Choose Merge Lines to replace line breaks with a separator.
Frequently asked questions
How do I truncate text by line?
Paste or upload text, set Maximum characters per line, and read Trimmed output. The tool applies the limit to each line and updates the output when the text or controls change.
Can trim lines to max length split a word?
Yes. A word is split when the selected limit lands in its middle. The tool cuts at the character position instead of moving back to a word boundary.
Does the ellipsis count toward the maximum characters?
Yes. The ellipsis counts inside Maximum characters per line when Add an ellipsis when a line is trimmed is selected. Lines that fit the limit keep their text.
Can I copy or download the truncated text?
Yes. Use Copy trimmed text to place the result on the clipboard or Download trimmed text to save it as a text file. The original stays in Input text.