Skip to content
cosmodev ~/tools/html-entity-encoder

HTML-entitetskodare/avkodare

Encoders & Crypto

Koda text till HTML-entiteter och avkoda entiteter tillbaka till text (namngivna + numeriska). UTF-8-säker, körs helt i din webbläsare, med en delbar länk till exakt din inmatning.

0 tecken · 0 bytes

Utdata
Skriv eller klistra in text för att koda den.

0 tecken · 0 bytes

(Dokumentation på engelska)

What it does

The HTML Entity Encoder/Decoder converts text to HTML entities and back. Encode escapes the five HTML-significant characters (& < > ' ") into their named references (&amp; &lt; &gt; &apos; &quot;) so arbitrary text is safe to embed in HTML. Optionally, switch to Encode to numeric and every non-ASCII character - accents, symbols, emoji - is also turned into decimal numeric references (© → &#169;), producing ASCII-safe output for legacy charsets or email. Decode resolves the full HTML5 named set (&copy;, &hearts;, &eacute;, … over 2,100 names) plus decimal (&#169;) and hexadecimal (&#xA9;) references back into readable characters, leaving anything it doesn’t recognize untouched. Everything runs 100% client-side: nothing you paste is ever sent to a server.

How to use it

  1. Paste your text into the Input box (or hit Sample for a demo).
  2. Pick Encode or Decode from the segmented control on the left.
  3. When encoding, choose how to handle Non-ASCII characters: Leave as-is (escape only & < > ' ") or Encode to numeric (also convert every non-ASCII code point to &#NN;).
  4. Read the result in Output, which shows live char and byte counts.
  5. Copy the result, Swap to feed it straight back as input and flip direction, or Copy share link to send the exact view to a teammate.

Examples

Encode HTML special characters (Non-ASCII: Leave as-is)

Input: <a href="x">Tom & Jerry's</a>

Output:

&lt;a href=&quot;x&quot;&gt;Tom &amp; Jerry&apos;s&lt;/a&gt;

Encode everything non-ASCII to numeric (Non-ASCII: Encode to numeric)

Input: © 2026 - €5

Output:

&#169; 2026 &#8212; &#8364;5

Decode named and numeric entities

Input: Copyright &copy; 2026 &#x2014; &euro;5

Output:

Copyright © 2026 - €5

Good to know

  • Unknown entities pass through: &bogus; and bare ampersands like Tom & Jerry are left untouched, never mangled or errored.
  • Robust by design: out-of-range code points (&#999999999;) and lone surrogates are preserved as-is - the decoder never throws.
  • Shareable: your input and settings are encoded in the URL (?mode=…&a=1&t=…), so a link reproduces the exact view.
  • Private: all encoding and decoding happens locally in your browser - safe for sensitive content.
  • Related tools: Base64Base64An encoding representing binary data as 64 safe ASCII characters, so it survives transport through text-only channels. It encodes — it does not encrypt., URL Encode/Decode, JSON Formatter.
Källkod14 språk

100% på klientsidan · dina data lämnar aldrig din webbläsare. Hittade du detta användbart? Dela det med en kollega.