Text Justifier
Wrap text to a set line width and justify it so every line (except the last) reaches both edges evenly, the way printed columns and typeset paragraphs look.
Alignment
Common Use Cases
About Text Justifier
Justified text, where every line in a paragraph is stretched to reach exactly the same width on both the left and right edges, is what gives newspaper columns, typeset books, and printed documents their clean, block-shaped look. It's done by re-wrapping the words to a target width and then distributing extra spaces between the words on each line until the line reaches that width exactly, without touching the words themselves.
This tool re-wraps any pasted text to a line width you choose (in characters, which is what matters for plain-text and monospace contexts: code comments, terminal output, plain-text emails, ASCII documentation) and justifies each line by spreading extra spaces evenly between words. When a line's spaces don't divide evenly, the leftover space is distributed one extra character at a time starting from the earliest gaps, the same approach used by classic typesetting and word processors. The last line of a paragraph is left as-is by default, since a fully stretched final line (often just one short word spread across the whole width) usually looks wrong; there's a toggle to force it fully justified anyway if that's what you need.
Besides full justification, the tool also supports plain left-aligned wrapping (just re-wrap, no space-stretching), right-alignment, and centering, useful for formatting ASCII banners, README sections, or code comments where you want the wrap without the justified block look. Multiple paragraphs (separated by a blank line) are re-wrapped independently by default, so blank lines in your original text are preserved as paragraph breaks rather than being swallowed into one continuous block.
Everything happens with plain JavaScript directly in your browser: nothing you paste is uploaded, logged, or transmitted anywhere.
Frequently Asked Questions
How does the justify algorithm decide where to add extra spaces?
Why isn't the last line of my paragraph fully justified?
What happens to a word that's longer than the line width?
Does it respect the paragraph breaks (blank lines) in my original text?
Is my text uploaded anywhere while it's being formatted?
Related Tools
View all Text ToolsURL Extractor
Automatically extract every URL from pasted text, logs, or documents. Deduplicate, sort, and export the list as .txt or .csv, entirely in your browser.
Number to Words Converter
Convert numbers into written-out English words and back again: supports negatives, decimals, and values up to the decillions, entirely in your browser.
Roman Numeral Converter
Convert numbers to Roman numerals and Roman numerals back to numbers, with instant validation that flags malformed input as you type, entirely in your browser.