UtilityKit

500+ fast, free tools. Most run in your browser only; Image & PDF tools upload files to the backend when you run them.

Word Wrap / Hard Wrap

Wrap text at a specified column width with either soft wrap markers or hard newlines for terminal, email, and code formatting.

About Word Wrap / Hard Wrap

The Word Wrap / Hard Wrap tool reformats text by inserting hard newlines at a specified column width, ensuring no line exceeds the chosen character limit. Unlike soft word wrap in text editors (which is only visual), hard wrapping embeds actual newline characters into the text. This is essential for plain-text emails (RFC 2822 recommends 76 characters), Git commit message bodies (72 columns), terminal output, code comments, and any context where line length must be strictly controlled. The tool wraps at word boundaries by default to avoid breaking words mid-syllable, but also offers a character-exact mode for cases where strict column alignment is required.

Why use Word Wrap / Hard Wrap

  • Inserts real newlines — not just visual wrap — for plain-text portability.
  • Configurable column width from 40 to 200+ characters.
  • Word-boundary wrapping prevents broken words in the output.
  • Ideal for emails, Git commits, terminal scripts, and code comments.
  • Generates real \n line breaks rather than visual-only soft wrapping.
  • Preserves paragraph boundaries by leaving blank lines untouched.

How to use Word Wrap / Hard Wrap

  1. Paste the text you want to wrap into the input area.
  2. Set the column width (default 80 characters).
  3. Choose whether to wrap at word boundaries or exact character positions.
  4. Copy the hard-wrapped output from the result area.
  5. Choose word-boundary wrapping for prose and exact-character wrapping only when alignment matters.
  6. Use a column width of 72 for Git commits, 76 for plain-text email, or 80 for terminal output.
  7. Verify the result by counting characters on the longest line — your code editor's status bar usually shows column position.

When to use Word Wrap / Hard Wrap

  • Formatting plain-text emails that require 76-character line limits.
  • Wrapping Git commit message bodies at 72 characters per convention.
  • Preparing terminal output or man page content with fixed line widths.
  • Wrapping long code comments to fit within a project's line-length limit.
  • Pre-formatting plain-text README files for old terminal viewers.
  • Wrapping log file content to fit dashboard widgets with fixed column widths.

Examples

Standard 40-column wrap

Input: The quick brown fox jumps over the lazy dog and runs back home again.

Output: The quick brown fox jumps over the lazy dog and runs back home again.

Git commit body (72)

Input: Refactor the user service to use the new authentication middleware and remove the deprecated session cookies.

Output: Refactor the user service to use the new authentication middleware and remove the deprecated session cookies.

Email line (76)

Input: Hello team, please review the attached document and send your comments back by Friday end of business.

Output: Hello team, please review the attached document and send your comments back by Friday end of business.

Tips

  • Use 72 columns for Git commit message bodies — that is the universal convention.
  • Use 76 or 78 for plain-text emails per RFC 2822 — leaves room for the leading '> ' in quoted replies.
  • Use 80 for general terminal output — most legacy terminals are 80 wide.
  • If wrapping reveals long unbroken sequences (URLs, hashes), consider hyphenating manually or using exact-character mode for one pass.
  • After wrapping, paste into a fixed-width font editor to verify visual alignment.

Frequently Asked Questions

What is the difference between soft wrap and hard wrap?
Soft wrap is visual only — the editor displays shorter lines but the underlying text has none. Hard wrap inserts actual newline characters, making the line breaks permanent in the text.
Does it preserve existing blank lines?
Yes. Blank lines (paragraph separators) are preserved so the paragraph structure of the original text is maintained.
What column width should I use for email?
RFC 2822 recommends lines of 78 characters or fewer. 76 characters is a safe maximum that accounts for any added prefix characters.
What about already-wrapped text that I want to reflow?
First remove existing line breaks (you can use the text cleaner to join lines), then apply the new column width.
Does it handle indented text?
Yes. The tool preserves leading whitespace on each paragraph when wrapping, so indented blocks remain indented in the output.
What if my text already has line breaks?
Existing line breaks within paragraphs are joined first, then the text is rewrapped at your specified width. Blank lines (paragraph separators) are preserved.
Does it count Unicode characters or bytes?
It counts Unicode characters (code points). For wide CJK characters, you may want to allow extra padding because each occupies two terminal columns.
Can it wrap inside long URLs?
Word-boundary mode keeps URLs intact even if they exceed the width. Use exact-character mode if you need to force wrapping mid-URL.

Explore the category

Glossary

Hard wrap
Inserting actual newline characters into text at a target column width — survives copy-paste.
Soft wrap
Visual-only line wrapping in an editor; the underlying text has no newlines.
Column width
The maximum number of characters allowed per line in a hard-wrapped document.
RFC 2822
The IETF standard for plain-text email message format, recommending lines under 78 characters.
Carriage return
The \r character, used (with \n) for Windows-style line endings.
Paragraph separator
A blank line that delimits paragraphs in plain text — preserved by good wrapping algorithms.