Skip to content
ZeroServer.tools

Word Wrap / Text Wrapper

Hard-wrap text to a fixed line width without breaking words.

characters per line
Wrap Width: 60Characters: 0

What hard wrapping does

Soft wrapping is what your editor does visually; hard wrapping inserts real line breaks so the text stays narrow everywhere it's pasted — commit messages (the classic 72-column rule), email, README files, and fixed-width terminals. This wrapper is word-aware: it never splits a word across lines, it greedily fits as many words as possible under your chosen width, and it preserves your existing paragraph breaks. Everything runs locally in your browser.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Hard-wrapping a commit message or an email to a fixed width.
  • Formatting a comment block to a project's line-length convention.
  • Wrapping text for a terminal or a plain-text document.
  • Preparing prose for a format that does not soft-wrap.
  • Reflowing a paragraph after editing changed its length.

Frequently Asked Questions

What is the difference between hard and soft wrapping?
A soft wrap is the editor DISPLAYING a long line across several rows with no character stored; a hard wrap inserts real newlines into the file. Only hard wrapping changes the data, which is what this does.
Why is 80 columns the traditional width?
It comes from the IBM punched card, which held 80 characters, and carried into terminals. It survives because line length genuinely affects readability — typographic research puts comfortable prose at roughly 50-75 characters.
How are long words handled?
This is the awkward case. A word longer than the width must either overflow the limit or be broken mid-word. URLs are the usual culprit, and breaking one makes it unusable — so most wrappers let it overflow.
Does wrapping break code or Markdown?
It can, badly. Hard-wrapping a Markdown table or a fenced code block destroys it, and wrapping indentation-sensitive code changes its meaning. Wrap prose; leave structured text alone.
What about non-Latin scripts?
Whitespace-based wrapping fails on Chinese, Japanese and Thai, which do not space their words. Those scripts have their own line-breaking rules (UAX #14), including characters forbidden at the start or end of a line.
Where should a line break when there is no space?
At a hyphen or after certain punctuation, and otherwise nowhere — a long URL or identifier simply overflows. Breaking inside it changes the text, which is why a wrapper leaves it long and lets the display scroll.
Why is wrapping different for CJK text?
Because there are no spaces between words, so a line may break between almost any two characters. What constrains it is a set of rules forbidding certain characters from starting or ending a line — kinsoku shori.

Common errors and gotchas

  • Wrapping code, where a hard break can change meaning or break a string.
  • Choosing a width that does not match the destination, so it wraps twice.
  • Breaking a URL across lines, which makes it unclickable and often unrecoverable.
  • Wrapping already-wrapped text, which produces very short alternating lines.
  • Counting characters when the destination measures display width, which differs for wide characters.

Related Text Tools tools

Private & free — this tool runs entirely in your browser.