Skip to content

Menu

HTML Entity Encoder

Encode and decode HTML entities — named, decimal, and hex formats.

Runs entirely in your browserEncodingFree, no sign-up
Loading tool

01What is HTML Entity Encoder?

You paste text with ampersands, angle brackets or curly quotes into an HTML template and the page breaks, or worse, runs something. This tool turns those characters into HTML character references, and it can turn references back into characters. It has three tabs: Encode, Decode and Reference. On the Encode tab you pick one of three formats. Named gives &amp;, Decimal gives &#38; and Hex gives &#x26;. In every format the five characters HTML treats as special are always escaped: &, <, >, the double quote and the apostrophe. Every character above ASCII is escaped too. Plain letters, digits, spaces and ordinary punctuation stay as they are. Numeric references use the full Unicode code point. So an emoji becomes one reference such as &#128512; instead of two broken surrogate halves. The HTML Living Standard from WHATWG accepts both decimal and hex references for any code point, so either format renders the same character. Named mode uses a built-in table of about seventy common characters. It covers the HTML basics, the non-breaking space, currency and legal signs, dashes, curly quotes, arrows, fractions, maths symbols like &le; and &ne;, and a few Greek letters. Anything not in that table falls back to a decimal reference. For example, "I'm 😀" in Named mode gives I&apos;m &#128512;, while Hex mode gives I&#x27;m &#x1F600;. The Decode tab relies on your browser's own HTML parser. It understands every named entity in the HTML standard plus numeric references in either base. It also decodes exactly one level, so &amp;lt; becomes &lt;. Every < is escaped before parsing and the result is read back as plain text, so tags in your input never become live markup. The Reference tab is a searchable table of 42 frequently used characters with their named, decimal and hex forms. Each one copies with a click. Treat it as a cheat sheet, since the standard defines more than 2,000 names. Some honest limits. Named mode only knows its own table, so plenty of characters with official names still come out as numbers. Escaping protects text you place inside HTML, but it does not clean markup you intend to render. The conversion runs on the text in your open tab, and the tool does not send it to a server.

Frontend developers and content editors who need to place user text or special symbols safely inside HTML, or read escaped text back. The tool runs entirely in your browser, so your data never leaves your device.

02How to use HTML Entity Encoder

  1. Pick the Encode or Decode tab. Loading an example switches to the right tab for you.
  2. On Encode, choose a Mode: Named, Decimal or Hex.
  3. Paste your text into the input box. The output updates as you type.
  4. Open the Reference tab and use its search box to find a specific character's forms.
  5. Copy the result into your HTML.

03Worked examples

Input: Encode, named: <a href="x">Tom & Jerry</a>
Result: &lt;a href=&quot;x&quot;&gt;Tom &amp; Jerry&lt;/a&gt;
Input: Encode, decimal: <a href="x">Tom & Jerry</a>
Result: &#60;a href=&#34;x&#34;&#62;Tom &#38; Jerry&#60;/a&#62;
Input: Encode, hex: café – 5 > 3
Result: caf&#xE9; &#x2013; 5 &#x3E; 3
Letters, digits and spaces stay as they are. Only non-ASCII and HTML-special characters change.
Input: Encode, named: a ≤ b ≠ c
Result: a &le; b &ne; c
Maths symbols in the tool's table get their names.
Input: Encode, named: I'm 😀
Result: I&apos;m &#128512;
The emoji has no name in the table, so it falls back to a decimal reference for its full code point.
Input: Encode, hex: I'm 😀
Result: I&#x27;m &#x1F600;

04Common use cases

  • Escaping a comment or username before dropping it into an HTML email template
  • Turning <div> snippets into visible code for a documentation page
  • Converting a price line with € and £ to named entities for a legacy CMS
  • Producing hex references for a non-ASCII string that has to pass through an ASCII-only system
  • Decoding &ldquo; and &rdquo; left behind in scraped article text
  • Looking up the named, decimal and hex forms of a symbol like &middot; while writing markup

05Tips

  • Hex mode writes the apostrophe as &#x27;. That form also works in older HTML 4 pages, where &apos; was not defined.
  • Decimal and Hex modes cover every code point, while Named mode silently falls back to decimal for anything outside its table.
  • If a decoded string still shows &lt; or &amp;, it was encoded twice. Decode it again.
  • Use &shy; for an optional break point inside a long word. The browser only shows the hyphen when it actually wraps there.
  • Encode values at the point where they enter HTML, not when you store them. Otherwise you end up with double encoding later.

06Related concepts

Character reference, Unicode code point, XSS prevention, HTML5 entities.

Frequently Asked Questions

What is HTML Entity Encoder?

HTML Entity Encoder is a free, browser-based developer tool on AIDToolStack. Encode and decode HTML entities — named, decimal, and hex formats. It requires no installation or sign-up and works entirely in your browser.

Is HTML Entity Encoder free to use?

Yes. No sign-up, no fees and no usage cap.

Does HTML Entity Encoder store my data?

No. It runs in your browser; nothing is uploaded.

Cheat sheet

Related Tools

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe