# mathiasbynens/he

A robust HTML entity encoder/decoder written in JavaScript.

Repository: https://github.com/mathiasbynens/he
Canonical: https://ross.abutalabs.com/products/he
Homepage: https://mths.be/he
Language: JavaScript
License: MIT
License Family: permissive
Topics: html-entities, javascript, encode, encoder, decode, decoder
Last push: 2021-12-29T22:20:03+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4817, "days_push": 1708, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3597, forks 262 (observed 2026-08-28T04:08:11.368815+00:00)

## What it is
A robust JavaScript library for encoding and decoding HTML entities, supporting all standardized named character references per the HTML spec. It handles ambiguous ampersands, astral Unicode symbols, and edge cases exactly like a browser would.

## Use cases
- encode text into HTML entities
- decode HTML entities back to text
- sanitize user input for safe HTML output
- handle astral Unicode symbols in HTML
- escape special characters like ampersands and angle brackets
- match browser behavior for character reference parsing

## When to choose
- you need spec-compliant HTML entity encoding/decoding in JavaScript
- you must handle full Unicode including astral symbols correctly
- you want browser-identical handling of ambiguous ampersands

## When to avoid
- you need general HTML parsing or sanitization rather than entity handling
- you work outside JavaScript ecosystems
- you need actively developed features, as the project is in maintenance mode

## Facets
- artifact type: library
- maturity: maintenance
- function: serialization, parser
- domain: web-development, developer-tools
- platform: browser, cross-platform
- tags: html-entities, encoder, decoder, unicode, character-references, natural-language-processing, nodejs

## Member repositories
- mathiasbynens/he (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:11.368815+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:33:46.845792+00:00, confidence not recorded.
  - readme: https://github.com/mathiasbynens/he (fetched 2026-08-28T04:08:11.368815+00:00, sha 867d15b9e669)
  - homepage: https://mths.be/he (fetched 2026-08-29T09:27:16.161614+00:00, sha 50f5c1e1a464)
  - registry_npm: https://registry.npmjs.org/he (fetched 2026-08-29T09:27:16.170885+00:00, sha d5a34f967922)
- Data as of 2026-08-30T08:39:29.467469+00:00.
