Justified text except the last line is the default behavior of every justification engine: full justification stretches every line to both margins except the last line of a paragraph, which is left-aligned. There is no separate setting to turn on for this — it is what justification means. The rule to remember: justification applies to all lines but the final one, and the final line keeps its natural ragged edge unless you force it otherwise.
If your last line is stretching across the full width, that is a different setting or a manual break, not justification itself. The sections below explain why the last line behaves this way, how to fix a stretched last line in Word, CSS, and InDesign, and when you might actually want the last line justified.
Why the Last Line Stays Ragged by Design
Justification works by adding space between words (and sometimes between letters) so each line reaches both margins. That only makes sense for lines that are full of text. The last line of a paragraph usually holds only a few words, so stretching it to the full column width would create enormous, ugly gaps between those words.
Every major typesetting system treats the last line as an exception for this reason. Word, CSS, InDesign, LaTeX, and plain HTML all leave the final line left-aligned under normal justification. The ragged edge is not a bug or a missing setting — it is the correct output.
There is one common exception: a line that ends with a manual line break (Shift+Enter in Word) is treated as a new line, not the paragraph's last line, so it does get justified. That is one of the most frequent reasons a reader sees a stretched short line and assumes justification is broken.
The Stretched Last Line Is Usually a Line Break
If a short line in the middle of a paragraph is stretched to both margins, look for a manual line break. In Word, press the paragraph mark button (the pilcrow, ¶, on the Home tab) to show formatting marks. A manual line break appears as a bent arrow, while a paragraph break appears as the pilcrow. Delete the bent arrow and replace it with a space or a normal Enter, and the line will reflow and stop stretching.
The same thing happens in HTML. A <br> tag ends a line but not the paragraph, so the text before it is justified as if it were a full line. If a line looks wrong in a browser, check the source for a <br> where you expected a new paragraph.
In InDesign, a forced line break (Shift+Enter) behaves the same way. Use a paragraph return instead when you want the previous line to stay ragged.
Other causes of a stretched final line
A paragraph that ends with a tab or a run of trailing spaces can also produce odd spacing. Turn on invisible characters and delete trailing whitespace. In CSS, a very narrow container with text-align: justify and only two or three words on the last line can look stretched even when the engine is behaving correctly, because the browser still distributes the available space. Widening the container or reducing the font size fixes the appearance.
Turning Justification On in Word, CSS, and InDesign
In Word, select the paragraph and press Ctrl+J, or go to Home > Paragraph group > Justify. The last line stays left-aligned automatically. To change how the last line is treated, open the Paragraph dialog (click the small arrow in the Paragraph group), go to the Indents and Spacing tab, and look at the Alignment dropdown. The Justify option is the standard one; the Justified Low, Justified Medium, and Justified High options change how aggressively Word stretches lines, not whether the last line is justified.
In CSS, set text-align: justify on the element. The last line is left-aligned by default. To justify the last line too, add text-align-last: justify. To keep the last line left-aligned explicitly, use text-align-last: left. Browser support for text-align-last is broad, but check the result in the browsers your readers use, because rendering of the last line can differ slightly.
In InDesign, select the paragraph and open the Paragraph panel. Choose Justify with last line aligned left (the standard option) from the alignment row. The other justify options — Justify with last line aligned center, right, or fully justified — control the final line specifically. Labels can differ slightly between versions, so check the alignment icons in the panel if the wording does not match.
When to Force the Last Line to Justify
Forcing the last line to justify is rare in body text and common in two places: table cells and short display lines. In a table column where every cell is justified, a ragged last line can look inconsistent, so text-align-last: justify is sometimes used to make cells line up. The trade-off is visible: a cell holding two words will show a wide gap between them.
For headings and single-line labels, justification is almost never appropriate. A heading stretched to the full column width looks accidental, and the gaps between words can be larger than the words themselves. Keep headings left-aligned or centered.
For poetry, addresses, and code blocks, do not justify at all. Line breaks carry meaning in those formats, and justification distorts the spacing that the author intended.
A quick decision rule
Use justified text with a ragged last line for multi-line body paragraphs in print or long-form web reading. Use left-aligned text for short lines, headings, tables with narrow columns, and any block where line breaks are meaningful. Reserve text-align-last: justify for table cells and short display lines where the alignment mismatch is more distracting than the gaps.
Checking the Result Before You Publish
Justification quality depends on line length and word length. A column narrower than about 40 characters produces large gaps between words even with correct justification, because there are too few words per line to distribute space evenly. Widen the column or switch to left alignment if the gaps look bad.
Turn on hyphenation when you justify. Without it, long words push to the next line and leave the previous line with wide gaps. In Word, go to Layout > Hyphenation > Automatic. In CSS, use hyphens: auto together with the correct lang attribute on the HTML element, because hyphenation dictionaries depend on the declared language. In InDesign, enable hyphenation in the Paragraph panel.
Check the final line of every paragraph for stray manual breaks and trailing spaces, then view the page at the widths your readers will actually use. A layout that looks clean at one width can show stretched lines at another, especially in responsive web layouts where the column narrows. If the gaps become unacceptable at narrow widths, a media query that switches to left alignment below a chosen width is a common and effective fix.
Finally, remember that the ragged last line is expected. If a client or reviewer asks why the last line is not justified, the answer is that justification by definition applies to all lines except the last, and forcing it usually makes the paragraph look worse. Show them the alternative with the last line justified, and the gaps will make the case for you.