Justif – Knuth-Plass justification and microtypography for the web

Justif is a drop-in JavaScript library that progressively enhances web pages to TeX-level text justification. Installation is a single <script> line, standard text and accessibility affordances are unchanged, and users with JS disabled get native browser rendering.I made justif because I've long been a fan of justified text. I think it looks clean and elegant, and makes reading more enjoyable. But bad justification is the opposite, with gaping spaces that distract me to the point of making the text near unreadable.Browsers have got better recently at handling justified text [0][1], but still use suboptimal greedy algorithms for the most part, and are not near that TeX/InDesign level of quality that I crave. `text-wrap: pretty` exists but is far from a panacea, as you can see for yourself in the demo.Justif also has the benefit of providing more consistent text layout across browsers. Blink (Chrome), Gecko (Firefox) and WebKit (Safari) all justify text differently, so normally what the user sees depends on what browser they use.Take a look at the demo, play around with it, see if you can break anything. I'm open to improvements of the API design as well, so please let me know your thoughts.For more details, see the README: https://github.com/lyallcooper/justif0: https://cloudfour.com/thinks/justified-text-better-than-expe...1: https://owickstrom.github.io/the-proportional-web/

Hacker NewsToolAISource
0Sign in to voteCopy link

FL score

42

out of 100

Verdict

SKIP

medium confidence

Competition

No competitor data yet

Trend

No signal yet

A JavaScript library that applies TeX-quality text justification to web pages, solving the problem of ugly spacing in browser-rendered justified text.

The pain

Justified text on the web looks bad because browsers use greedy line-breaking algorithms that create uneven spacing. This is especially noticeable in narrow columns or long words. Designers want justified text for aesthetic reasons but avoid it because the result is often unreadable. The problem varies across browsers (Chrome, Firefox, Safari render differently), making consistent design impossible.

The gap

Browsers have improved (CSS `text-wrap: pretty` exists) but still don't match TeX/InDesign quality. No drop-in solution exists that gives designers fine-grained control over justification without rebuilding their entire text rendering pipeline. The library fills this gap with a single script tag.

Build angle

Start by validating whether designers and publishers actually care enough to install a script for this. The current approach assumes the pain is acute, but justified text is a niche preference. Test with design-focused communities (design agencies, publishing platforms, premium blogs) to see if they'll adopt it. If adoption is real, expand to offer: (1) configuration options for different justification styles, (2) performance optimization for large documents, (3) integration with popular CMS platforms. The real business angle is likely B2B (selling to design tools or publishing platforms) rather than B2C.

Strengths

  • Solves a real problem that affects visual quality and consistency across browsers
  • Low friction to install (single script tag) and gracefully degrades
  • Addresses a gap that major browsers haven't solved despite years of development
  • Creator has clear passion and understanding of typography
  • Technically sound approach (Knuth-Plass algorithm is proven)

Risks

  • Extremely niche audience, most web designers don't prioritize justified text, and many actively avoid it for mobile/responsive reasons
  • Performance risk: JavaScript-based text layout is slower than native rendering and could cause layout shift or jank on large pages
  • Maintenance burden: needs constant testing across browsers and devices as web standards evolve
  • No clear monetization path, this is a free utility that solves a problem most people don't have
  • Accessibility concerns: justified text can harm readability for dyslexic users; the library doesn't address this
  • Market size is tiny: only applies to sites that use justified text, which is already a small subset of the web

Questions about this idea?

FlyBot reads the scoring and gives you a second opinion on “Justif – Knuth-Plass justification and microtypography for the web”.

Open FlyBot