Skip to content
ToolPlankDEV
Text Tools
100% In-Browser Execution

Updated:

Word Wrap Online

Paste text and wrap it at a width you choose with this word wrap online tool. Lines break between words, comment and quote prefixes such as // and > stay on every line, lists get a hanging indent, and a ruler shows the limit. Nothing is uploaded.

Processing in browser...

Loading the tool. It runs entirely in your browser, so your data is never uploaded.

More free tools you may need next.

Quick Guide

How to use Word Wrap

Simple step-by-step instructions to get the exact output you need.

  1. 01

    Paste your text

    Paste or type text in the left box, press Paste to read the clipboard, or drop a .txt or .md file on it. Example loads two paragraphs, and Code example loads a comment, a quote and a list.

  2. 02

    Set the width

    Press a preset such as 72 or 80, or type any width from 4 to 1000. The ruler above the result marks the last column, and the status line shows the longest line of the result.

  3. 03

    Choose how to wrap

    Wrap Between words never splits a word. At the exact width cuts every line at the limit. Long words decides what happens to a word longer than the width. Rejoin paragraphs first removes old line breaks before wrapping again.

  4. 04

    Copy or download

    The wrapped text updates as you type. Press Copy, or Download to save wrapped.txt. Lines that are longer than the width are shown in a different colour and explained in a note.

How to wrap text at a fixed width

To wrap text online at a width, paste it and choose the width. The tool fills each line with as many words as fit and starts a new line before the word that would go over. The Example text wrapped at 40 characters looks like this:

Text
Wrapping text at a fixed width keeps
plain text readable in an email, a
terminal or a README. Set the width, and
every line is broken between words so
that none is longer than the limit.

A blank line starts a new paragraph, and
paragraphs are wrapped on their own.

A blank line starts a new paragraph and is kept. Spaces at the end of a wrapped line are removed, and the space where a line was cut disappears, so no line starts or ends with a gap. The width counts characters, and an emoji or a letter with an accent counts as one.

Comments, quotes and lists keep their prefix

Plain wrapping breaks code comments and quoted email. The second line of a comment loses its slashes, and the second line of a quote is no longer quoted. With Keep // # > - prefixes on, the tool finds the marker at the start of the line and repeats it on every line it creates. The Code example at width 44 gives:

Text
// This helper reads the settings file,
// merges it with the defaults and returns a
// frozen object that the rest of the
// application can share safely.

> Quoted replies keep their marker, so a
> long quoted line stays a quote after it is
> wrapped at the chosen width.

- A list item wraps with a hanging indent,
  so the second line lines up under the
  first word of the item.
  • Comment markers: //, ///, #, ##, -- and ; followed by a space. A word that only starts with a hash, such as #tag, is text.
  • Quote markers: > and nested > > markers.
  • List markers: -, * and + bullets, and numbers such as 1. and 2). The wrapped lines are indented to line up under the first word.
  • Indentation: spaces and tabs at the start of the line are kept on every line, including inside a comment.
  • A line with a javadoc star, one space then * and a space, keeps that star.

The prefix counts toward the width, so a line never goes past the limit because of it. If the prefix itself takes almost the whole width, a note tells you to raise the width. Turn the option off to treat everything on the line as text. Extra indent on wrapped lines in More options adds spaces to the second and later lines of a plain paragraph.

Word wrap or hard wrap, and what happens to long words

Word wrap breaks only at spaces. Hard wrap cuts at the exact width, even in the middle of a word, and keeps the spaces it finds. Use it for fixed-width fields and punched-card style formats, not for prose.

A word that is longer than the width, such as a URL, cannot be fitted by breaking at spaces. Long words set to Keep whole leaves it on its own line, a little past the limit, so the link still works. Break them cuts it into pieces of the full width. The status line and a note count the lines that go over the width.

Rejoin old line breaks before wrapping again

Text that was wrapped at 72 and now needs 80 would wrap into ragged short lines if the old breaks stayed. Set Existing line breaks to Rejoin paragraphs first. Lines of one paragraph are joined with a single space, then wrapped at the new width. The tool starts a new paragraph at a blank line, at a list marker, and when the prefix or the indentation changes, so quoted text, comments and lists are not run together.

Keep each line, the default, wraps every line on its own and leaves your line breaks where they are. That suits text where each line is already a unit, such as a list of sentences. To only join lines without wrapping, use Remove Line Breaks, which is the reverse of this tool.

Wrap text at 72 or 80 characters for commits, email and code

Many projects ask for commit message bodies wrapped at 72 characters, so the text still fits in a terminal after Git indents it. Plain text email is traditionally kept to about 76, and code style guides commonly use 80, 100 or 120. The presets cover these, and any width in between works. A commit body wrapped at 72 looks like this:

Text
This body line is much longer than the rules of the project allow, so it
has to be wrapped at seventy two characters before it is committed.

The subject line of a commit is a separate rule and is normally kept short, so wrap only the body. If you only want to cut text into parts of a given size, Text Splitter does that. Add Text to Each Line adds a prefix to lines after wrapping, and Remove Extra Spaces tidies spaces before it.

Wide characters, tabs and counting in columns

By default the width counts characters, and a character is what a person sees as one symbol, so an emoji with a joiner or a letter with a combining accent is one. A terminal draws Chinese, Japanese and Korean characters and many emoji two columns wide. Set Count width in to Columns and those count as two, and a tab counts as the tab width you pick, so the result fits a terminal of that width. Characters with no width, such as combining marks, count as zero.

Counting in columns uses a built-in list of wide characters. It follows the common East Asian width rules but is not a full copy of the Unicode tables, so check unusual symbols in your own terminal.

Limits and privacy

The page accepts up to 2 million characters. The preview shows the first 1,000 lines, while Copy and Download include everything. A markdown heading that starts with # is treated as a comment marker, so wrapping it repeats the hash on every line. Turn the prefix option off for such text.

The text is wrapped in your browser and is not sent to a server or stored. See the Privacy Policy for details.

Frequently Asked Questions

Technical Q&A for Word Wrap

Common questions about edge cases, character encoding, and privacy guarantees.

Paste the text and press the 80 preset. Each line is broken between words so that none is longer than 80 characters. Copy the result or download it as a .txt file.

Word wrap breaks only at spaces, so words stay whole. Hard wrap cuts at the exact width, even inside a word. Choose between them with the Wrap option.

Yes. A blank line stays a blank line, and each paragraph is wrapped on its own. Use Rejoin paragraphs first to remove old line breaks inside paragraphs.

72 characters is the common rule for the body, and the subject line is kept shorter. Press the 72 preset and wrap only the body.

Yes. With Keep // # > - prefixes on, comment markers, quote markers and indentation are repeated on every line. List items get a hanging indent.

By default it stays whole on its own line, a little over the width, so a link keeps working. Set Long words to Break them if every line must fit.

Yes. An emoji or a letter with an accent counts as one character, and a tool for fixed-width screens can count wide glyphs as two columns with Count width in.

Set Existing line breaks to Rejoin paragraphs first. The lines of each paragraph are joined and then wrapped at the new width, so the result has no short ragged lines.

Use Remove Line Breaks. It joins the lines of each paragraph back into one line and keeps the blank lines between paragraphs.

No. The text is wrapped in your browser, and nothing is sent to a server or stored.