Word Wrap Calculator

Lines—
Longest line—
Words—

How Word Wrap Calculator is calculated: Words are packed greedily onto each line until the next word would pass the width, then a new line starts. Words stay whole; only a word longer than the width is split.

What is a word wrap calculator?

A word wrap calculator takes a long line of text and cuts it into shorter lines, each no longer than the width you choose, breaking only between words so that no word is ever split. Set the width to 20 and the sentence “The quick brown fox jumps over the lazy dog” — 43 characters, 9 words — becomes 3 lines: “The quick brown fox”, “Jumps over the lazy”, and “dog”, with the longest line 19 characters. The default text and the default width of 20 are already set on this page, so you can see the result before you type anything.

Word wrapping is how every word processor, email client, and web page lays out text. You type one long line, and the software breaks it into lines that fit the window, always between words, never through them. This tool does the same thing on demand, with a width you control, so you can see exactly where the breaks will fall before the text goes anywhere.

This tool shows the count as well as the wrapped text: the number of lines, the longest line, and the word count, so you can check that the longest line never passes your width and that no word was lost. Everything runs in your browser — nothing is uploaded, nothing is stored, and there is no account to create. If you only need to know how long the text is, a character counter gives you the length before you wrap.

Wrapping is not the same as shrinking text. Nothing is deleted: every word in the input appears in the output, in the same order, with only line breaks added. The 9 words you typed are still 9 words after wrapping — they are just spread over 3 lines instead of 1.

How word wrapping works: pack words until the line is full

The method is greedy and exact. The tool takes the words one at a time and packs them onto the current line: a word joins the line if the line plus a space plus the word still fits inside the width, and when the next word would pass the width, the line is finished and a new one starts. The formula is: fill each line with as many whole words as fit, then break. A 43-character sentence at width 20 gives 3 lines, because the words pack as 19, 19, and 3.

The longest line is usually shorter than the width. The first line is “The quick brown fox” at 19 characters, not 20, because the next word, “jumps”, would make the line 25 characters — past the limit. That one-character gap is the price of keeping words whole, and it is a price worth paying: a line one character short reads perfectly, while a word split in half does not.

Only one case breaks the rule: a single word longer than the width. A 25-letter word at width 20 has nowhere to go — it cannot fit on any line whole, so the tool splits it across two lines, exactly as a hard wrap would. Everything else stays whole. A word counter beside the tool confirms that wrapping never changes the word count — it only adds line breaks.

Choosing the right wrap width

The width is the whole decision, and it depends on where the text is going. A plain-text email is usually wrapped at 72 characters, the old standard that keeps quoted lines readable. A narrow column on a web page might need 40 or 50. A printed receipt or a label might need 20, like the default on this page.

Small widths make more lines. The default sentence is 43 characters: at width 20 it becomes 3 lines, at width 10 it becomes 5 lines — “The quick”, “brown fox”, “jumps over”, “the lazy”, and “dog” — and at width 43 it stays 1 line. The longest line at width 10 is exactly 10, because “jumps over” fills the line completely.

A width that is too small makes the text hard to read in a different way: short lines mean the eye jumps back and forth constantly, and a paragraph becomes a tower of fragments. Pick the widest width the destination allows: the text stays readable, the lines stay short enough, and the number of lines stays small. If the destination is a fixed-width system where no line may pass the limit even by splitting a word, a hard text wrap tool is the tool that cuts at the width no matter what.

There is one more consideration: proportional fonts. This tool counts characters, not pixels, so it is exact for monospace text and approximate for proportional text, where a line of 20 narrow letters is shorter on screen than a line of 20 wide ones. For emails, manuscripts, and plain text, character counting is exactly right — those systems measure width in characters by definition.

A worked example: wrapping at width 20

Take the default text: “The quick brown fox jumps over the lazy dog”. It has 43 characters and 9 words. At the default width of 20, the tool packs the words greedily. The first line takes “The” (3), “quick” (5), and “brown” (5), then “fox” (3) — 3 + 1 + 5 + 1 + 5 + 1 + 3 = 19 characters. The next word, “jumps”, would make 25, so the line ends at 19.

The second line takes “jumps” (5), “over” (4), “the” (3), and “lazy” (4) — 5 + 1 + 4 + 1 + 3 + 1 + 4 = 19 characters. The next word, “dog”, would make 23, so the line ends at 19. The third line is “dog” — 3 characters. That is 3 lines, a longest line of 19, and 9 words.

Now change the width to 10 and watch the numbers move. The same 43 characters become 5 lines: “The quick” (9), “brown fox” (9), “jumps over” (10), “the lazy” (8), and “dog” (3). The longest line is 10, the line count is 5, and the word count is still 9 — wrapping adds breaks, never words.

At width 43, the whole sentence fits on one line: 1 line, longest line 43, 9 words. At width 44, the answer is the same, because the text is only 43 characters long and there is nothing left to wrap. The longest line tells you the truth in every case: it is the width you set, or the length of the text, whichever is smaller.

Who uses a word wrap calculator, and why

Writers and editors are the biggest users. Plain-text emails, newsletters, and manuscripts must survive as text files, where the line width is part of the format, and an email wrapped at 72 characters reads well in every mail client. A writer who pastes a draft here sees exactly where the breaks will fall before the text goes out.

Developers are the second group: commit messages, documentation, and comments that must fit a width limit, where a checker rejects any line over 72 or 80 characters and the developer needs to find the long lines fast. A message wrapped here passes the checker the first time.

Students are the third group: assignments and code submissions with line-length limits, where wrapping the text before submitting saves a round of corrections. Data workers are the fourth group — people who prepare text for receipts, labels, and narrow displays, where the width is fixed and the words must stay whole or the output is unreadable.

Word wrap calculator vs text wrap tool

A word wrap calculator and a text wrap tool do the same job with one different rule. The word wrap calculator breaks on word boundaries, so words stay whole, but a line can end up one or two characters short of the width. The text wrap tool cuts at exactly the width, even in the middle of a word, so no line is ever longer than the limit.

Use the word wrap calculator when a person will read the text — a paragraph, an email, a message — because a reader trips over a word split in half, and a line one character short is a small price for keeping words whole. Use the text wrap tool when the width is a hard limit that nothing may pass — a terminal, a code block, a label printer, a fixed-width file.

A reading time calculator is the natural partner for readable text: it tells you how long the wrapped paragraph takes to read, while the wrap tool tells you how it fits on the page. A paragraph counter answers the question wrapping raises — how many blocks did the text have? — and the answer is the line count shown above the output.

Common mistakes when word wrapping text

The most common mistake is wrapping text that is already wrapped. Running the tool twice on the same text adds breaks to breaks, and the second run treats the already-short lines as paragraphs to wrap again. Wrap once, from the original, and if the width was wrong, go back to the original and wrap again at the new width.

Second: picking a width smaller than the longest word. At width 5, the word “quick” becomes “quic” and “k”, because a word longer than the width has nowhere to go. If the text has long words, the width must be at least as long as the longest word, or the words will split no matter which tool you use.

Third: expecting every line to reach the width. Word wrapping leaves gaps — the default sentence at width 20 has lines of 19, 19, and 3, because the next word never quite fits. A longest line shorter than the width is not a bug; it is the proof that the words stayed whole.

Fourth: forgetting that wrapping adds characters. A line break is a character, so wrapped text is longer than the original by the number of breaks added. The default sentence is 43 characters and 3 lines, so the wrapped output is 45 characters including the 2 breaks. If a system counts the breaks, the total is higher than the character count shown.

How to use this word wrap calculator

Using this word wrap calculator is simple. Type or paste your text into the box — the default sentence is already there. Set the wrap width — 20 is the default — and the wrapped text appears in the output box below, with the line count, the longest line, and the word count shown above it. Copy the output with the copy button, or select it by hand.

To change the width, type a new number: 72 for an email, 80 for a terminal, 40 for a narrow column. The lines re-pack instantly, and the longest line shows the new width. If the longest line is shorter than the width you set, the words simply did not fill the line — nothing is wrong.

Everything runs in your browser. No sign-up, no account, no data sent anywhere — your text never leaves your device, and the page works offline once it has loaded. Try it with something real before you need it: paste a paragraph, wrap it at 40, then at 72, and watch the line count fall as the width grows. Once you have done it twice, choosing a wrap width stops feeling like a guess and starts feeling like a measurement.

Frequently Asked Questions

Word wrap breaks on word boundaries, so words stay whole and lines can end a little short of the width. Hard wrap cuts at exactly the width, even in the middle of a word, so no line is ever longer than the limit. Use word wrap for text people read, hard wrap for terminals and code.

Because the next word did not fit. The default sentence at width 20 has lines of 19, 19, and 3 — the first line is 19 because adding “jumps” would make it 25. A line shorter than the width is the proof that the words stayed whole, not a bug.

It gets split. A word longer than the width cannot fit on any line whole, so the tool cuts it across two lines, exactly as a hard wrap would. Set the width to at least the length of your longest word if you want every word whole.

No. Wrapping only adds line breaks; every word in the input appears in the output in the same order. The default sentence has 9 words before wrapping and 9 words after, at any width.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.