# highlight.js: 6.9 out of 10

Reasonable, with limits. 4th of 8 in [Code editors and highlighters](https://elestia.ai/opensource/code-editors/index.md).

highlight.js is a zero-dependency syntax highlighter that runs at runtime, covers 190+ languages and can guess a snippet's language. It is reliable and very widely installed, but maintenance has thinned to roughly one active maintainer. For new framework or build-step projects, Shiki now highlights more accurately.

**Best for:** Pages, CMSs and server code that need simple runtime highlighting with language auto-detection and no build step.

## Scores

- **Overall: 6.9** (likely 5.9 to 7.9)
  - Claude Opus 5.5 (6.0): It is a safe, fast and simple choice for runtime highlighting, and the only common one with auto-detection. Thin maintenance holds it back, and for most new framework or build-step projects Shiki gives more accurate output and has the momentum. It ranks below Shiki and around Prism, and it does not compete with the editors in this category.
  - GPT-6.2 Sol (7.8): highlight.js is a strong pick when a page needs to color user-supplied snippets quickly, especially when the language may be missing. Shiki is the stronger choice when a build-time pipeline can supply language labels and matching VS Code coloring matters. Established production use supports confidence in highlight.js today, while the recent publishing gap leaves its future release cadence uncertain.
- **Needed by many: 5.3** (likely 4.3 to 6.4)
  - Claude Opus 5.5 (6.0): Highlighting code is common on docs sites, blogs, chat apps and dev tools, but most web apps do not need it. highlight.js covers only the highlighting half of the category and none of the editing. It works on any runtime and framework, so its audience is not narrowed further.
  - GPT-6.2 Sol (4.6): Read-only code highlighting serves documentation, forums, and repository viewers across frameworks. The library covers the display side of the category, while Monaco and CodeMirror also handle editing. The sources show several distinct uses, with little evidence about what share of JavaScript projects need them.
- **Helps a lot: 7.3** (likely 6.3 to 8.3)
  - Claude Opus 5.5 (6.5): It does the job well: it is fast, it auto-detects languages, it covers a broad set of grammars and themes, and it ships types. Its limits are clear. The regex grammars are less exact than Shiki's on complex code, the full bundle is large, and the output is fixed HTML with no token API. Shiki does the same job better for build-time and framework sites.
  - GPT-6.2 Sol (8.1): Version 11.12.0 combines broad language coverage, selective imports, and typed APIs with clear examples that are easy for coding agents to follow. An independent comparison found it faster than Shiki and slower than Prism on its sample, with Shiki producing more precise coloring. Language detection is heuristic, and an open TypeScript report illustrates how grammar edge cases can interrupt highlighting. Performance and accuracy still depend on the languages and inputs a project uses.
- **Holds up over time: 5.9** (likely 4.7 to 7.2)
  - Claude Opus 5.5 (5.0): Releases resumed in 2026 with 11.11.2 and 11.12.0, there were 139 commits last year, and publishing moved to npm Trusted Publishers. But the project's own news said it had been inactive for about a year. A revoked token broke the release pipeline for months, and one maintainer carries most of the work. The ecosystem's default for new docs tooling is moving towards Shiki.
  - GPT-6.2 Sol (6.7): The project recorded 139 commits and two releases in the past year, and two core team members handled its latest GitHub releases. Publishing resumed after a year-long gap, and the maintainers are recruiting reviewers while some grammar bugs remain open for a year or more. The v12 milestone has no due date, and long-term funding and release coverage remain unclear.
- **Used widely: 8.5** (likely 7.4 to 9.2)
  - Claude Opus 5.5 (8.5): It has the most dependents in the category, with 700k repos and 11k packages, far above Prism's 219k. It also has the most downloads, at 213M per 4 weeks. Much of that comes through other packages such as markdown renderers and lowlight. Its growth ratio of 4.45 is only slightly above the 4.1 median, while Shiki grew about 9.7x, so its share of new projects is flat to falling.
  - GPT-6.2 Sol (8.4): Ecosyste.ms found about 701,000 dependent repositories and 11,300 packages, with repository counts well ahead of Prism and Shiki. Four-week npm downloads grew 4.45 times year over year, slightly above the 4.1 catalog median and well behind Shiki's 9.70 times. Automated installs and wrappers such as lowlight inflate the download count, while CDN use bypasses npm, so the rate of direct adoption is harder to estimate.
- **Vouched for: 7.5** (likely 6.5 to 8.4)
  - Claude Opus 5.5 (6.5): It is long-established and built into many markdown, docs and forum tools, and independent comparisons still recommend it for runtime highlighting. Current endorsements from big frameworks have gone mostly to Shiki, which is the default in Astro, VitePress and others. Hacker News and Bluesky show almost no recent discussion.
  - GPT-6.2 Sol (8.4): GitLab uses highlight.js in its repository file viewer, and Stack Exchange uses it to color code blocks across its sites. Asciidoctor.js ships an adapter, and Tiptap uses it through lowlight. These integrations show where it works in production, while survey evidence on satisfaction and retention is sparse.
- **Safe: 8.0** (likely 7.0 to 9.0)
  - Claude Opus 5.5 (8.0): It has zero dependencies and a BSD-3-Clause licence. Its only two advisories, a ReDoS and a prototype pollution, date from 2020 and were fixed. Publishing now uses Trusted Publishers. The Scorecard is 6.6, with weak checks for token permissions, pinned dependencies and fuzzing, and the small maintainer team is a residual risk.
  - GPT-6.2 Sol (8.0): Zero runtime dependencies and a permissive BSD-3-Clause license keep dependency risk low. Both known moderate advisories date to 2020 and were fixed before the current release line. npm publishing moved to trusted publishing, and the Scorecard gives high marks for code review and the security policy. Weak workflow token permissions and dependency pinning, plus a zero fuzzing score, leave room for improvement.

## Good

- It has no runtime dependencies and needs only a script tag and `hljs.highlightAll()` to start.
- Language auto-detection is built in, which most peers lack.
- It is fast, both in the browser and in Node, and an independent benchmark measured it about 44x faster than Shiki.
- There are 190+ grammars and 100+ themes, and it is a mature, well-known API that AI agents write correctly.

## Bad

- Its regex grammars are less accurate than Shiki's TextMate/VS Code grammars on complex modern syntax.
- The full bundle is large (about 280 kB gzipped) unless you import the core and pick languages by hand.
- Maintenance rests mostly on one person, and the project said it had been inactive for about a year before its 2026 releases.
- It only highlights code. It cannot edit code, and it offers no token-level API for custom rendering.

## The numbers

- Downloads, 4 weeks: 213M
- In a year: ×4.4
- GitHub stars: 25k
- Commits, 12 months: 139
- Last npm release: Aug 2026
- Advisories, 24 months: 0
- Licence: BSD-3-Clause
- GitHub: https://github.com/highlightjs/highlight.js
- npm: https://www.npmjs.com/package/highlight.js

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 21 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
