Word Wrap Tool
Wrap text to a fixed line width instantly with word, balanced, and character modes
Updated
What is the Word Wrap Tool?
The Word Wrap Tool is a fast, private, and production-grade text formatter that reflows any paragraph to an exact line width. Whether you need the classic 80-column email standard, 72 characters for Git commits, or 40 characters for narrow mobile views, it wraps your text instantly without breaking words incorrectly.
Why line width matters
Unwrapped text is hard to read in plain-text emails, terminals, README files, and code comments. Fixed-width wrapping improves readability, keeps documentation consistent, and prevents horizontal scrolling. Most basic wrappers fail at bullet lists, long URLs, and quoted replies - this tool fixes all of that.
Key Features
- Three wrapping modes: Word (greedy), Balanced (optimal rag-minimizing), and Character (hard cut)
- Smart long-word handling: Break, keep overflow, or hyphenate with URL-safe protection
- Bullet & list aware: Detects
-,*,1.,a)markers and auto-aligns hanging indent - Paragraph control: Preserve blank lines, merge single breaks, collapse spaces, trim lines
- Quote & code ready: Add custom line prefix like
>for email quotes or//for comments and suffix - Indent control: First-line and hanging indent for professional paragraph styling
- Live ruler & stats: Visual column ruler, longest line, average length, overflow detection
- 100% client-side: No upload, no server, works offline - your text never leaves your browser
Perfect for
Developers wrapping code comments, writers formatting plain-text and Markdown, support teams reflowing email replies, students meeting line-length requirements, and anyone working with terminals, logs, or fixed-width displays.
How it works
1. Paste your text
Drop a .txt, .md, or log file or paste any paragraph into the input editor. The tool normalizes line endings and counts characters, words, and lines for stats.
2. Choose width and mode
Set your target width from 1 to 500 characters. Pick a wrapping algorithm:
Word Mode (Greedy) - The classic approach. It fills each line with as many whole words as fit, then moves to the next line. Fastest and familiar.
Balanced Mode - Uses dynamic programming to minimize raggedness. It looks ahead up to 14 words and chooses line breaks that make the right edge as even as possible, similar to Knuth-Plass. Ideal for publishing and documentation.
Character Mode - Cuts strictly at N characters regardless of words. Used for fixed-width data, terminals, and encoded payloads.
3. Configure edge cases
Long words and URLs: If a single token is longer than your width, choose Break to split it, Keep to allow overflow, or Hyphenate to add a trailing -. Enable Avoid breaking URLs to keep https://... intact whenever possible.
Paragraphs: With Preserve paragraphs, double newlines create new paragraphs. With Merge single line breaks, hard line breaks inside a paragraph become spaces before rewrapping, so you can reflow pasted PDFs. Disable it to wrap each existing line individually.
Bullets and lists: When enabled, the tool detects -, *, •, 1., 1), a. patterns. It keeps the marker on line one and adds spaces equal to marker length on continuation lines, creating true hanging indent.
Affixes and indents: Effective width = width - prefix - suffix - indent. First-line indent applies to line one of each paragraph, hanging indent to all others. Final line is built as prefix + indent + content + suffix.
4. Get results
The output is rendered live with a column ruler showing every 5th and 10th column. Stats show input vs output lines, longest line, average length, and any overflow lines. Copy with one click or download as wrapped.txt.
Examples
Wrap paragraph to 80 characters for email
Classic email and documentation wrapping with standard 80 column limit
Preserve bullet list with hanging indent
Keep bullet markers and align wrapped lines under text not the dash
Wrap quoted email with prefix
Reflow quoted text for email replies using greater-than prefix
Hard character wrap for data files
Force break every N characters for fixed width data and terminals
Frequently asked questions
What does a word wrap tool do?
What does a word wrap tool do?
A word wrap tool reflows text so no line exceeds a fixed column width you choose, like 80 characters. It breaks lines at word boundaries instead of in the middle of words, preserves readability, and can reformat paragraphs, quotes, and lists for email, code, documentation, and terminals.
What is the difference between word, balanced, and character wrap?
What is the difference between word, balanced, and character wrap?
Word mode is greedy and fast - it fills each line with as many words as fit and then starts a new line. Balanced mode uses optimal line-breaking to minimize uneven right edges, giving a cleaner block of text. Character mode ignores words and cuts strictly every N characters, which is useful for fixed-width data files and terminal displays.
How are long words and URLs handled?
How are long words and URLs handled?
You have three options. Break splits a long word across lines at your width. Keep overflow leaves the long word on its own line even if it exceeds width, so nothing is cut. Hyphenate adds a - at the break point. When Avoid breaking URLs is on, links starting with http://, https:// or www. are treated as unbreakable tokens and moved whole to the next line when possible.
Will it preserve my paragraphs and blank lines?
Will it preserve my paragraphs and blank lines?
Yes. With Preserve paragraphs enabled, two or more newlines start a new paragraph and are kept as a blank separator. You can choose to merge single line breaks inside a paragraph to reflow pasted text, or keep them to wrap each existing line separately. There are also toggles for trimming empty lines, collapsing multiple spaces, and trimming leading or trailing whitespace.
Does it keep bullet points and numbered lists aligned?
Does it keep bullet points and numbered lists aligned?
Yes, when Keep bullets is enabled. It detects -, *, +, •, 1., 1), a) and similar markers. The marker stays on the first line and continuation lines get automatic hanging spaces equal to the marker length, so wrapped text aligns under the text, not under the bullet.
Can I wrap text for email quotes or code comments?
Can I wrap text for email quotes or code comments?
Absolutely. Use Line prefix and Line suffix. Set prefix to > to reflow blockquotes for email replies, // for JavaScript comments, # for Python or shell, or * for JSDoc blocks. Add a suffix like \ if you need a continuation character. Indents are applied on top of the prefix.
What line width should I choose?
What line width should I choose?
Common standards are 72 characters for Git commit messages, 80 for plain-text email, code, and terminals, 100-120 for modern code editors, and 40-60 for narrow columns or mobile readability. Use the presets and the live ruler to preview. For prose, 60-80 is usually most readable.
Does this tool work offline and is my text private?
Does this tool work offline and is my text private?
Yes. The entire wrapping engine runs 100% client-side in your browser using pure TypeScript. No text is uploaded to a server, no network request is made, and file drops are read locally. You can disconnect from the internet after loading the page and it will continue to work.
Why are some lines still longer than my chosen width?
Why are some lines still longer than my chosen width?
This happens when a single unbreakable token like a long URL or a very long word is longer than your width and Long word mode is set to Keep overflow. Switch to Break or Hyphenate, increase width, or enable Avoid breaking URLs to move the whole URL to its own line. The tool highlights overflow line numbers so you can spot them quickly.
Related tools
More utilities you might find handy.
Anagram Checker
Check if two strings are anagrams with customizable normalization options.
Case Converter
Convert text to various cases like uppercase, lowercase, title case, camelCase, snake_case, and more, with additional text cleaning features.
Find & Replace Tool
Find and replace text instantly online with regex, whole word, case matching, preserve case, and batch rules. 100% client-side.