Skip to content
TextArray
100% local

Justify text

Re-flow plain text into block-justified lines of an exact character width.

Input
Output

Justify text

Word processors justify text by nudging letter spacing in tiny fractions — plain text cannot do that, but monospaced justification can: distribute whole extra spaces into the gaps between words until every line hits the exact same width. That is what this tool does. Paste your text, set the line width in characters, and each paragraph re-flows into a clean block where every line but the last is exactly as wide as the next.

The algorithm is the classic one from typesetting: greedy wrap to the target width, then pad each line's word gaps evenly, giving leftmost gaps the remainder. The last line of every paragraph stays ragged-left with single spaces, exactly as a book would set it. Blank lines pass through untouched, so multi-paragraph text keeps its structure, and existing line breaks inside a paragraph are treated as soft — the text re-flows as one stream, which is what you want when pasting from an e-mail or a PDF.

Width is measured in characters, which makes the result align perfectly wherever a fixed-width font rules: code comments, READMEs, man pages, plain-text e-mails, ASCII documents, terminal output. Accented letters and emoji count as one column each. A word longer than the width gets its own overlong line rather than being broken.

Everything runs locally in your browser — the text never leaves your device. Combined with the copy button, it turns "make this paragraph look neat in a fixed-width file" into a five-second job.

FAQ

Why is the last line of each paragraph not stretched?
That is how block justification works in print: stretching a short final line would produce huge gaps. The last line keeps single spaces and stays left-aligned, like the final line of any justified paragraph in a book.
How are the extra spaces distributed?
Evenly across the gaps between words, with the remainder going to the leftmost gaps. A line needing 5 extra spaces over 3 gaps gets 2, 2, 1. The distribution is deterministic — the same input always gives the same output.
What happens to words longer than the line width?
They are placed on their own line and exceed the width rather than being hyphenated or cut — an URL or long identifier stays intact and searchable.
Does it respect my existing line breaks?
Line breaks inside a paragraph are treated as soft and re-flowed; blank lines are paragraph boundaries and survive. To justify each original line separately, add a blank line between them first.
Is my text uploaded anywhere?
No. The justification runs entirely in your browser and your text never leaves your device.