What this tool does
This tool hard-truncates each input line to the selected maximum length. A word can be split when the limit falls inside it. The shortened text appears in a separate output area, while the input remains unchanged. Removed characters are not preserved in the output.
How to trim lines
- Enter text in the input area, or use Upload or Drop file to read a file as text.
- Set Maximum characters per line in the numeric field. It accepts
1to50and starts at3. Use Increase value or Decrease value to change it. - Optionally select Add … when trimmed to add an ellipsis to shortened lines.
- Read the output area. The output updates when the input or the trimming controls change; there is no separate Run control.
Copy or download the result
Use Copy to copy the output text. Use Download to create a plain-text download. When no custom filename is supplied, the shared download handler uses a page-based name such as trim-lines-max-length-output.txt.
Limits and browser file handling
Uploaded content is read in the browser with FileReader.readAsText. The shared upload code states that files do not leave the browser. The implementation does not clearly document accepted file formats, an upload-size limit, empty-line handling, Unicode or multi-code-unit character counting, or the error message and failure behavior for unreadable files.
When Add … when trimmed is enabled, the ellipsis is included within the configured maximum.
- Trimming shortens lines; it does not add padding or make all lines equal in length.
- Keep the original input if you may need characters removed from the output.
Frequently Asked Questions (FAQs)
How to truncate multiple lines of text?
Enter or upload your text, set Maximum characters per line from 1 to 50, and check the output area for shortened lines. When Add … when trimmed is enabled, the ellipsis is included within the selected maximum.
Can trimming split a word?
Yes. Hard truncation can cut through a word when the selected limit falls in the middle of it.
What happens to the original input?
The input area and output area are separate. The shortened output does not preserve removed characters, so keep the original input if you may need the untrimmed text.