Skip to main content
TOP free online tools Your Workbench
English

HTML Entity Encoder / Decoder

Free online html entity encoder / decoder. Process data instantly in your browser. No upload, no signup, fully private.

Local browser processing — zero server uploads
0Input chars
0Output chars
0Entities

How to Use

  1. Choose Encode or Decode mode and paste your text or HTML entities into the left pane (or click Sample).
  2. When encoding, choose Named, Decimal, or Hexadecimal format and toggle whether to encode all non-ASCII characters.
  3. Copy the live result with Copy, swap panes with Swap, or click Reset to clear.

What is HTML Entity Encoder / Decoder?

HTML Entity Encoder / Decoder converts special HTML syntax characters (`&`, `<`, `>`, `"`, `'`), typographic symbols (`&nbsp;`, `&copy;`, `&euro;`, `&mdash;`), and Unicode characters to and from safe HTML character references. Developers use it to display literal code snippets on web pages, sanitize text inside attributes, and decode escaped API or XML strings.

How It Works

In Encode mode, `encodeHtmlEntityText` iterates over Unicode code points (`for...of`), escaping reserved HTML characters and optionally all non-ASCII code points (`code > 127`) as named entities (such as `&amp;`, `&lt;`, `&copy;`), decimal `&#code;`, or hex `&#xCODE;`. In Decode mode, `decodeHtmlEntityText` resolves named HTML entities plus valid decimal and hexadecimal numeric references back to UTF-8 characters locally without touching the DOM.

Common Use Cases

  • Displaying raw HTML or XML in tutorials — escape `<tag>` brackets and `&` ampersands so browsers render code visibly instead of executing markup
  • Safely embedding text in HTML attributes — convert double quotes, single quotes, and ampersands before inserting strings into templates
  • Converting Unicode symbols for ASCII-only pipelines — encode accented letters, currency signs, and emojis into `&#...;` or `&#x...;` entities
  • Decoding scraped or RSS/XML payloads — reverse `&nbsp;`, `&quot;`, `&mdash;`, and numeric character references back into readable text
Technical Details

Pure TypeScript Unicode-aware encoder/decoder (`encodeHtmlEntityText` / `decodeHtmlEntityText`) supporting Named, Decimal (`&#N;`), and Hexadecimal (`&#xH;`) formats, non-ASCII toggle, surrogate-safe `String.fromCodePoint` validation, and live entity counters.

FAQ

Is this HTML Entity Encoder / Decoder free?

Yes, completely free. No signup required.

Does this tool upload my data?

No. All HTML entity encoding and decoding happens locally in your browser.

What entity formats are supported when encoding and decoding?

Encoding supports Named (&amp;, &lt;, &copy;, &nbsp;), Decimal (&#38;), and Hexadecimal (&#x26;) formats with an optional toggle for non-ASCII characters. Decoding resolves named HTML5 entities as well as decimal and hex numeric entities.