Justify Text
Align text evenly between left and right margins
What Is the Justify Text Tool?
The Justify Text tool reformats plain text so that each line stretches evenly from the left edge to a right margin you set, using extra spaces between words to fill out the line width. You specify the total character width, click Justify Text, and the tool pads the spacing across each line so both edges line up cleanly. It is designed for plain-text environments where CSS text-align and word processor formatting are not available.
The typical use is formatting text for monospace displays, printed plain-text documents, terminal output, or any fixed-width context where ragged right edges look untidy. Justified text in a proportional font is a different matter and this tool is not really built for that.
How to Use This Tool
- Paste or type your text into the input box above.
- Set the Width value to the total number of characters you want each line to fill. The default is 60, but you can set it to match whatever column width your target display uses.
- Click Justify Text and the tool distributes extra spaces between words on each line so they stretch to fill the specified width.
- Copy the result using the Copy button, or select and copy manually. Use Clear to reset the input.
When Would You Use This?
Formatting plain-text documents or reports where you want the text to look tidy against both left and right edges, without using a word processor or layout application.
Preparing text for a terminal display, a command-line output, or a README file where a clean fixed-width column looks more considered than ragged lines of different lengths.
Creating plain-text layouts for print, notices, or signage where the content needs to sit inside a specific character-width column and both margins should align consistently.
Examples
Justifying a short paragraph at 40 characters wide
Input : The quick brown fox jumps over the lazy dog near the river bank.
Width: 40
Output : The quick brown fox jumps over the
lazy dog near the river bank.(Extra spaces distributed between words to fill each line to 40 characters)
Justifying a two-line block at 50 characters
Input : Plain text formatting can be useful in terminal output and fixed width documents.
Width: 50
Output : Plain text formatting can be useful in
terminal output and fixed width documents.(Each line stretched to 50 characters with distributed spacing)
Short line left unchanged (last line of paragraph)
Input : This is a longer sentence used to show how justification works across multiple lines in a block.
Width: 40
Output : This is a longer sentence used to
show how justification works across
multiple lines in a block.(Last line is left as-is since it is too short to justify meaningfully)
Frequently Asked Questions
What does justify text mean?
Justified text means the text is aligned along both the left and right edges of a column. Extra space is added between words to stretch each line out to the full width, so neither edge looks ragged. Most word processors do this visually with proportional spacing, but this tool does it with literal space characters for plain-text output.
How do I justify text in plain text?
Paste your text into the input box, set the width to your target column size, and click Justify Text. The tool inserts extra spaces between words on each line to fill it out to the specified width. This only works correctly in monospace fonts where all characters are the same width.
How do I justify text in Word?
Select your text in Microsoft Word, then click the Justify alignment button in the Home tab (or press Ctrl+J). Word handles proportional spacing automatically. For plain-text files that are not in Word, this online tool is the more direct option.
How do I justify text in HTML or CSS?
Use the CSS property text-align: justify on the element containing your text. This works in all modern browsers and handles the spacing automatically. The Justify Text tool here is for plain-text output, not for web page styling.
What is the difference between left align and justify?
Left alignment lines up all text along the left edge but leaves the right edge uneven. Justified text aligns along both edges by adding spacing between words. The trade-off is that justified text can sometimes look awkward if a line has only two or three words and a lot of space gets inserted between them.
How does text justification work?
The tool counts how many characters are in a line after word-wrapping it to your specified width. It then calculates how many extra spaces are needed to reach that width and distributes them between the words on the line. The last line of a paragraph is typically left as-is without extra padding.
Can I justify text in Google Docs?
Yes. Select the text and click the Justify alignment button in the toolbar, or press Ctrl+Shift+J. For plain-text content outside of Google Docs, use this tool instead.
Why does justified text sometimes look strange?
Justified text can produce uneven gaps between words, especially on short lines or lines with long words. This is called "rivers" in typography, where the eye follows gaps across multiple lines. It is more noticeable in narrow columns. The last line of each paragraph is usually left-aligned to avoid a single short line being stretched awkwardly.
Does this tool work with monospace fonts only?
Yes, effectively. Justification by character count only looks accurate in monospace fonts like Courier or Consolas, where every character occupies the same horizontal space. In proportional fonts the spacing will look off because letters vary in width.