# alecthomas/chroma

A general purpose syntax highlighter in pure Go

Repository: https://github.com/alecthomas/chroma
Canonical: https://ross.abutalabs.com/products/alecthomas-chroma
Language: Go
License: NOASSERTION
License Family: other
Topics: go, golang, syntax, highlighting, highlighter, library, tool, html, console
Last push: 2026-08-26T04:39:19+00:00

## Health v2 (maintenance only)
Score: 97/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 92, longevity 100
- inputs: {"age_days": 3374, "days_push": 7, "days_rel": 56, "gap_med": 16, "n_releases_24m": 22}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5022, forks 507 (observed 2026-08-28T04:09:04.866735+00:00)

## What it is
Chroma is a general-purpose syntax highlighter written in pure Go, heavily based on Pygments, with translators for Pygments lexers and styles. It converts source code into syntax-highlighted HTML, ANSI-colored terminal text, and other formats, and ships with a CLI tool.

## Use cases
- highlight code snippets as HTML for a blog or docs site
- colorize source code in terminal output with ANSI colors
- add syntax highlighting to a Go static site generator
- identify the language of a code snippet automatically
- convert Pygments lexers and styles for use in Go
- highlight code in a CLI tool written in Go

## When to choose
- you need syntax highlighting in a Go project without external dependencies
- you want Pygments-like highlighting without a Python runtime
- you need both HTML and terminal (ANSI) output formats
- you need support for a very wide range of languages

## When to avoid
- you need a JavaScript/browser-side highlighter
- you need features Pygments has that Chroma lacks
- you are not working in Go and can use Pygments directly

## Facets
- artifact type: library
- maturity: stable
- function: parser, developer-tools, cli
- domain: developer-tools, web-development
- platform: go, cross-platform, cli
- tags: syntax-highlighting, pygments, html-formatter, ansi-colors, lexers, command-line

## Member repositories
- alecthomas/chroma (main) score 97

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:04.866735+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:17:29.205928+00:00, confidence not recorded.
  - readme: https://github.com/alecthomas/chroma (fetched 2026-08-28T04:09:04.866735+00:00, sha c4b74e4bdea1)
- Data as of 2026-08-30T08:39:29.467469+00:00.
