mathiasbynens/he

A robust HTML entity encoder/decoder written in JavaScript.

View on GitHub ↗Jump to charts ↓Open shareable report →

mathiasbynens/he has 3.5k+ stars and 250+ forks on GitHub, is written in JavaScript, and was last pushed on Oct 4, 2026. Data as of . Signed-in members get hourly updates — create a free account.

Summary Information

Updated 31 minutes ago
Type:Library / SDKCategory(s):Core & Utility LibrariesLanguages & Runtimes
Added to GitGenius on October 4th, 2026
Created on June 25th, 2013
Open Issues & Pull Requests: 23 (+0)
GitHub issues: Enabled
Number of forks: 264
Total Stargazers: 3,607 (+0)
Total Subscribers: 57 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 23.9 days
Mean response time: 714.5 days
90th percentile: 2632.8 days
Tracked items: 6

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 6
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,629 days
Stale 30+ days: 5
Stale 90+ days: 5

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

Sign in to see which issues are moving.
Sign in

Detailed Description

he is a robust HTML entity encoder and decoder written in JavaScript.

The tool solves the problem of safely converting between plain text and HTML entity-encoded text. It handles encoding by replacing symbols that aren't printable ASCII with character references, and decoding by converting character references back to their original symbols. The implementation follows the HTML specification's tokenization rules, handling edge cases like ambiguous ampersands the same way browsers do. A distinctive strength is its support for astral Unicode symbols, which many other JavaScript solutions fail to handle correctly.

Developers should choose this tool if they need standards-compliant HTML entity handling in JavaScript environments. It works across Node.js, browsers, and other JavaScript runtimes. The encoder offers configurable behavior through options: the `useNamedReferences` option enables named character references like `©` instead of hexadecimal escapes, though this may affect compatibility with older browsers; the `decimal` option switches to decimal escapes instead of hexadecimal; and the `strict` option causes the encoder to throw an exception when encountering invalid code points rather than silently passing them through. The tool guarantees that valid input produces valid HTML output.

The project maintains an extensive test suite and demonstrates active quality assurance practices. Development activity shows consistent attention to specification compliance and edge case handling.