Back to blog
CSS5 min read

Why the CSS ch Unit Beats Random Pixels for Clean Typography

Chris from Pixelbricks•

Every few months, the web design world falls head over heels for a shiny new trend. One week someone claims generative algorithms will replace front end coding entirely… the next, everyone is adding heavy interactive three dimensional shapes that send laptop fans screaming into orbit.

Meanwhile, basic reading on the web remains a bit of a lottery.

Have you ever opened a blog post on an ultra wide monitor only to find a single sentence stretching forty inches across your desk? Your neck gets an accidental workout just trying to track from line one to line two. Or worse, a developer decided that thirty percent width sounded tidy, resulting in three words per line on an iPad.

There is a tiny CSS unit that solved this exact headache years ago. It requires no complex calculations, no bloated runtime libraries, and zero corporate fuss. It is the humble ch unit… and if you are not using it to tame your paragraphs, you are making life much harder than it needs to be.

What on Earth Is a ch Unit Anyway?

Most CSS units make intuitive sense at a glance. Pixels refer to device screen dots. Viewport widths track the browser window. Rem units scale with root font sizing.

Then sits ch.

In the official CSS specification, 1ch represents the advance measure of the zero glyph (0) in the currently applied font and font size.

/* Equal to the width of roughly 65 zero glyphs in your body font */
p {
  max-width: 65ch;
}

Why the zero character? Typographers and browser engineers picked the zero because in most Western typefaces, zero is an average width glyph. It gives a practical baseline for how wide characters tend to be in a given font family.

If you swap your headline font from a narrow geometric sans serif to a sprawling slab serif, 1ch automatically adapts to match the width of that new font family. Set the font size bigger, and your ch measurements grow proportionally.

Advertisement

The Goldilocks Problem of Line Lengths

Good typography is not about making things look artsy for awards panels. It is about cognitive load. When readers scan a line of copy, their eyes move forward in small jumps called saccades. At the end of the line, the eye has to jump all the way back to find the start of the next line.

Here is how that usually goes wrong:

  1. •Lines that are too long: The reader reaches the far right edge of the screen, swings their eyes back to the left, and accidentally lands on the wrong line. Frustration ensues. They leave your site.
  2. •Lines that are too short: The eye bounces back and forth like a manic ping pong match. The natural rhythm breaks down, interrupting reading comprehension.

Print typographers sorted this out centuries ago. The universally accepted sweet spot for comfortable reading sits somewhere between 45 and 75 characters per line, with roughly 65 characters being the gold standard.

If you set max-width: 700px, you are guessing. On a font with narrow letterforms, 700 pixels might squeeze in 95 characters. On an extra bold display font, it might only hold 40. But if you write max-width: 65ch, you lock in ideal readability across every device without breaking a sweat.

Comparing Common Container Width Approaches

To see why the character unit keeps winning, look at how typical layout methods stack up against each other:

CSS ApproachBehaviour on Large ScreensScales with Font Size?Ideal for Body Copy?
max-width: 800pxCaps width nicelyNo, remains rigidTolerable, but brittle
width: 60vwExpands across ultra wide screensNo, tracks screen sizeRisky and unpredictable
max-width: 40remScales with root fontYes, but ignores typeface widthsGood, but needs manual checks
max-width: 65chCaps perfectly to reading rhythmYes, adapts to the exact fontExceptional for reading

Advertisement

Making Layouts Responsive Without Media Query Bloat

One of the best quirks of combining max-width: 65ch with modern CSS is how little layout code you actually need. You do not need five separate breakpoints to prevent your text from looking ridiculous.

Consider this standard, tidy container:

article {
  width: 100%;
  max-width: 65ch;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

On a mobile phone, width: 100% paired with inline padding keeps the text fitting comfortably within the edges of the screen. On desktop monitors, max-width: 65ch catches the container before it blows out into an unreadable horizontal ribbon. The text stays centred, readable, and completely indifferent to whether the visitor is using an old laptop or a giant gaming display.

The Performance Angle: Keeping Assets Lightweight

Clean CSS units like ch make your layout tidy, but visual presentation is only half the battle when crafting a pleasant reading experience. There is nothing quite as annoying as waiting for a pristine editorial layout to render while an unoptimised six megabyte camera raw file crawls down the wire.

Just as you keep your layout lightweight by letting smart browser properties do the heavy lifting, you should keep your media assets lean. If you are uploading photographic banners or screenshots for an article, converting them into modern WebP files will strip away the bulk without sacrificing sharpness. Tools like WEBP Converter let you batch convert standard JPGs and PNGs right inside your browser without uploading your imagery to random remote servers.

A snappy layout paired with featherweight images means your readers actually stick around long enough to appreciate your beautifully measured line lengths.

Frequently Asked Questions

Does the ch unit work the same way in monospace fonts?

In a monospace font, every character is intentionally the exact same width. That means 65ch in a code block will hold precisely 65 characters per line, down to the exact pixel. It makes ch brilliant for formatting code snippets and terminal previews.

Is the ch unit supported in modern browsers?

Yes, completely. The ch unit has enjoyed full support across all major browser engines, including Chrome, Safari, Firefox, and Edge, for well over a decade. You can use it today without polyfills or fallbacks.

Can I use ch for elements other than paragraphs?

Absolutely. It is particularly handy for input fields. If you know a postal code or telephone number field should only take roughly 10 characters, setting width: 12ch gives the user an intuitive visual cue about how much input is expected.

The Bottom Line

You do not need twenty lines of media queries or an experimental script just to give your visitors an easy reading experience. Stick max-width: 65ch on your main body text, leave the overcomplicated layout hacks behind, and let the browser do what it was designed to do.

CF

Chris from Pixelbricks

Web designer at Pixelbricks Design in London. Built WEBP Converter to help designers and developers optimise their images for free, right in the browser — no uploads, no limits, no cost.

Visit Pixelbricks Design →
Was this helpful?

Ready to optimise your images?

Try our free WebP converter and see the difference for yourself. Unlimited conversions, no registration required.

Start converting →

We use cookies

We use cookies to improve your experience and analyze how our website is used. Your images are always processed locally and never stored or tracked. You can learn more in our Cookie Policy.