Text word wrap
What is a Text Word Wrap?
Hard wrapping inserts real line breaks so that no line exceeds a set width. Many plain-text contexts expect it: Git commit message bodies (72 columns), code comments, README files viewed in terminals, plain-text email and fixed-width reports. This tool wraps text to the width you choose without splitting words.
How to use it
- Paste the text.
- Set the maximum line width, for example 72 or 80.
- Copy the wrapped result.
Example at 30 columns
Input:
Hard wrapping keeps long paragraphs readable in terminals and plain-text emails.Output:
Hard wrapping keeps long
paragraphs readable in
terminals and plain-text
emails.How the algorithm works
Words are added to the current line until the next word would exceed the width; then a new line starts. Paragraph breaks (blank lines) are preserved. A single word longer than the width, such as a long URL, is left on its own line rather than broken.
Common widths
- 50 / 72: Git subject line and body.
- 72 to 78: plain-text email (RFC 5322 recommends no more than 78 characters).
- 80: traditional terminal width and many code style guides.
- 100 or 120: modern code style guides for comments.
Hard wrap vs. soft wrap
Soft wrap is applied by the editor at display time and leaves the file unchanged. Hard wrap changes the text itself. Do not hard-wrap Markdown or HTML destined for responsive web pages; let the browser wrap it.
Frequently Asked Questions
What is the difference between hard wrap and soft wrap?
Hard wrap inserts real line breaks into the text. Soft wrap only changes how an editor displays long lines.
What width should Git commit messages use?
Keep the subject line under about 50 characters and wrap the body at 72 characters.
Does word wrap break long URLs?
No. A word longer than the width stays on its own line so links are not broken.
Are blank lines preserved?
Yes. Paragraph breaks are kept so the structure of the text is unchanged.