Word Wrap & Text Align
Wrap text at 72, 80 or any column and keep every prefix in place.
Wrapped in your browser; nothing is uploaded.
Settings
About the Word Wrap & Text Align
Hard-wrap text so that no line is longer than a chosen number of columns — 72 for plain-text e-mail and the body of Git commit messages, 80 for code, or any width from 2 to 1,000 — without breaking words. Paragraphs are re-wrapped as a whole, so a sentence edited in the middle no longer leaves a ragged line behind.
The wrapper keeps the structure of the text: indentation, quote markers (>), comment markers (//, #, --, ;, % and * inside /* … */ blocks) and list markers (-, *, 1., a)) stay on every line, and list items get a hanging indent. Code fences, tables and indented code samples are left alone. Chinese, Japanese and Korean characters and emoji count as two columns, as in a terminal, and text can be aligned left, centred, right or justified for monospace output.
How to use it
- Paste your text, or use Open file (or drop a file on the box).
- Choose a width: 72 for e-mail and commit messages, 80 for code comments, or type your own.
- Choose Re-wrap paragraphs to join and re-wrap each paragraph, or Only long lines to break just the lines that are too long.
- Pick an alignment, then copy or download the result. The output shows a guide line at the chosen column.
Examples
- Give every client its own bucket, keyed by API key, with the same refill rate as before.
- Give every client its own bucket, keyed by API key, with the same refill rate as before.
> We saw this last week, when one integration retried every failed request at once.
> We saw this last week, when one integration retried every failed > request at once.
Wrapped at 72 columns.
// Retry with exponential back-off so a failing service is not flooded.
// Retry with exponential back-off so
// a failing service is not flooded.あいうえお。かきくけこ
あいうえ お。かきく けこ
Wrapped at 10 columns: “お。” stays together because a full stop may not start a line.
Common uses
- Wrapping Git commit message bodies, plain-text e-mails and README files at 72 or 80 columns.
- Re-wrapping a code comment or docstring after editing it (PEP 8 asks for 72 columns in comments and docstrings).
- Formatting text for terminals, fixed-width displays, printers and monospace reports.
- Centring or right-aligning text in a plain-text banner or a code comment box.
Common line widths
- 72 columns: the body of Git commit messages, by wide convention, and plain-text e-mail, which leaves room for
>quote markers in replies. - 78 columns: the most an e-mail line should have under RFC 5322 §2.1.1 (lines must be at most 998 characters).
- 79 and 72: Python’s PEP 8 limits code lines to 79 characters and comments and docstrings to 72.
- 80 columns: the classic terminal width, and the limit in many C and shell style guides.
How columns are counted
Width follows Unicode’s East Asian Width property (UAX #11, Unicode 18.0): Chinese, Japanese and Korean characters, fullwidth letters and emoji take two columns; accents and other combining marks take none; tabs move to the next tab stop. Ambiguous characters such as Greek, Cyrillic and circled numbers take one column, as UAX #11 recommends when the context is unknown; tick the option to count them as two for East Asian fonts. The guide line in the output is drawn at the chosen column of the Latin font, so wide characters may not line up with it exactly.
Where lines may break
Lines break at spaces. Following the main rules of the Unicode Line Breaking Algorithm (UAX #14, Unicode 18.0): Chinese and Japanese text may break between any two characters, but never before closing punctuation such as 。、」 or small kana, and never after an opening bracket (strict line breaking); Thai, Lao, Khmer and Myanmar break between words found by your browser’s dictionary; Korean keeps whole words. A soft hyphen marks an optional break and shows a hyphen when used; no-break spaces never break. Breaking after hyphens in compound words is optional.
What is kept exactly
Some lines are never re-wrapped: fenced code blocks (between `` lines), table rows starting with |, horizontal rules, shebang lines (#!), /* and */` lines, and lines indented four or more columns deeper than the paragraph before them, which are code samples. A line ending in two spaces (a Markdown line break) ends its paragraph. Windows line endings are kept.
Limitations
- Works on up to 10 million characters at a time; split longer files into parts with the Text Splitter first.
- Line breaking follows the main UAX #14 rules, not the complete algorithm, so a few rare punctuation pairs may break differently than in a browser.
- A word or link longer than the line stays whole and sticks out, unless you tick Break words that are longer than a line.
- Lines starting with
#are treated as comments, so a long Markdown heading would be wrapped onto two lines that both start with#. - Re-wrapping uses one space between words, so double spaces inside a paragraph are not kept.
- Justify adds spaces between words only; Chinese and Japanese lines without spaces are left as they are.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
How do I wrap text at 80 characters without breaking words?
Paste the text and choose 80. Lines break only at spaces (and between Chinese or Japanese characters), so every word stays whole. A word longer than 80 characters is kept whole on its own line unless you tick Break words that are longer than a line.
Will it keep my // or # comment markers and indentation?
Yes. Each line’s indentation and quote or comment marker is repeated on every wrapped line, and lines with different markers are never joined. Untick Keep quote, comment and list prefixes to treat every line as plain text.
What is the difference between the two modes?
Re-wrap paragraphs joins the lines of each paragraph and wraps them again, like the fmt command or an editor’s re-wrap command. Only long lines leaves every line that already fits exactly as it is and breaks only the ones that are too long, like fold -s.
Why do Chinese and Japanese characters count as two?
In terminals, code editors and other monospace text they are drawn twice as wide as Latin letters, so a line of 40 Chinese characters is as wide as 80 Latin ones. Counting them as two keeps the right edge straight.
Is my text uploaded?
No. The text is wrapped in your browser and never leaves your device.