Wrap lines to a fixed length
Break every line into pieces of at most a set number of characters or display columns, optionally only between words.
Process locally
Files stay in this browser session. Closing or clearing releases them.
Add text
Type or paste the text to process
Adjust settings
Optional: Line length, Count, Break only between words
Run
Processes in this browser; cancel at any time
About this tool
Break long lines into pieces of a fixed length, such as 40 characters. Use it to fit text into a field with a per-line limit, split a long note into short chunks, or keep a plain-text email or text shown in a terminal at a tidy width.
Length can be counted in characters or in display width, where Chinese, Japanese and Korean characters count as two columns, and you can choose to break only at spaces. Emoji and accented letters are never cut in half. Up to 1 MB of text is processed in your browser and is not uploaded.
How to use it
- Paste your text, or select Use example.
- Set the “Line length” (1 to 1000, 40 by default) and choose how to “Count”: “Characters” or “Display width (Chinese counts 2)”.
- Tick “Break only between words” if English words should not be split.
- Select Run, then preview wrapped.txt and download it.
Formats and limits
- Input
- Text
- Output
- Plain text
- Size limit
- 1 MB
- Settings
- Line length; Count (Characters, Display width); Break only between words
- Privacy
- Files stay in the current browser session. No file bytes are uploaded.
- Price
- Free, no sign-up
Common questions
What is the difference between “Characters” and “Display width”?
With “Characters”, every character counts as one, Chinese included. With “Display width (Chinese counts 2)”, Chinese, Japanese and Korean characters and full-width punctuation count as two, so lines look equally wide in a monospaced font; at a length of 4, 中文abc becomes 中文 and abc.
Why are words cut in the middle?
By default the text is cut exactly at the line length. Tick “Break only between words” to break at the last space instead; a single word longer than the line length is still cut, and Chinese text without spaces is broken at the length as before.
Does it join short lines back together?
No. Existing line breaks are kept and each line is wrapped on its own, so short lines stay as they are. To re-flow a paragraph, first join its lines with a space in Split and join text.
Why do some lines start or end with a space?
Without “Break only between words”, the text is cut at exactly the line length and spaces stay where they fall. With that option on, the space at each break is removed.
Related tools
Line tools: trim, dedupe, sort
In one pass: trim lines, remove empty or duplicate lines, count repeats, filter by length, sort (including natural and pinyin order) and add a prefix or suffix.
Reverse text
Reverse the characters of text or of each line, the order of lines or words, or the items of a list or JSON array; emoji stay whole.
Split and join text
Split text at a delimiter into lines, or join lines with a delimiter, optionally quoting each item for SQL or CSV.
Text beautifier
Add a space between Chinese and English or numbers, optionally switch to Chinese punctuation and tidy paragraphs and spaces.
Letter case and naming styles
Change letter case line by line, or turn phrases and identifiers into camelCase, PascalCase, snake_case, kebab-case or CONSTANT_CASE.
Compare text
Compare two texts line by line with line numbers, and download a unified diff and a JSON report.