Why Does Justified Text Have Such A Bad Reputation On The Web?

Why Does Justified Text Have Such A Bad Reputation On The Web?

Photo by Mr Cup / Fabien Barral on Unsplash

If you open a book and look at how the lines of text are arranged on the page, in most books they are the same length and the text is an even block. Now look at the right edge of this web page. Unlike the book, the lines aren’t the same length; they’re different lengths depending on how many words there are in the line and how long those words are.

The text in the book is justified, with each edge of the text block making a straight line. The web page is set ragged right — it lines up against the left margin, but not the right. Why is the text of most books justified, and the text of most web pages not?

I’m a fan of justified text. I love a well-balanced page with wide margins and a symmetrical block of text. But, in general, I’d advise site owners against choosing justified text for anything but narrow columns on the web, and most web designers would agree with me.

Justifying text well is difficult. There are sophisticated algorithms for text justification that do quite a good job, but they’re usually only available in high-end desktop publishing software. They rely on the ability to split and hyphenate words, tweak the distance between words and letters, and sometimes even very slightly change the width of letters. And, for books, once an algorithm has had a shot at justifying the text, a human will check it over to make sure it’s acceptable.

The justification algorithms in browsers are nowhere near as sophisticated. They’ve improved over the last few years, but the basic technique just adds gaps between words. There will be no word-splitting and hyphenation, no careful calibration of letter and word spacing. Text justified in this way looks terrible. Often, the gaps between words line up and form rivers, large areas of white space disrupting the text block.

Publishers know the dimensions of books in advance. They only need to justify the text for that page and margin size. The web is a much more variable medium. Text has to look good on screens that range from low-resolution phones a few inches across to massive retina desktop displays. To effectively justify text on the web, the text placement, word-splitting, hyphenation, and letter spacing would have to be recalculated every time the browser’s window changed size. That takes a lot of computation, and many devices don’t have the processing or battery power to make it worthwhile.

Although some designers will tell you different, there’s nothing intrinsically wrong with justified text, on the web or otherwise. But there’s a lot wrong with poor justification, which is all the web platform has been able to manage. There are glimmerings of hope: the text-justify CSS property’s newspaper value uses a more sophisticated algorithm, but it’s only supported in recent version of Edge and Internet Explorer.

Matthew Davis is a technical writer and Linux geek for Future Hosting.

Dedicated Server Special

Take advantage of our Double RAM offer on the E3-1230v2 4 x 3.30GHz+HT server! Only $134.95 per month. Managed and Unmanaged options available at checkout.

GET STARTED