HTML Entity Encoder

Turn <, >, &, quotes, accents, and symbols into HTML character entities. Choose which characters to encode and whether to output named, decimal, or hex references — all in your browser, no server, no sign-up.

Try:
Encoded HTML

What this tool does

Paste text and get back the same text with special characters turned into HTML character entities. Two independent choices control the result:

Everything runs locally in your browser with WebAssembly. Nothing is uploaded, it works offline once loaded, and there is no sign-up.

Worked example

Input

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

Output (scope Minimal, format Named)

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

Only the five HTML-sensitive characters change; the letters, spaces, and slashes are left exactly as they were. Switch the scope to All non-ASCII and an input like Café © €5 becomes Caf&eacute; &copy; &euro;5 in named format, or Caf&#233; &#169; &#8364;5 in decimal.

Choosing a scope

ScopeEncodesUse it when
Minimal& < > " ' onlyInserting untrusted or literal text into HTML/XML so it renders as text, not markup.
All non-ASCIIthe five + every char above U+007FYou need pure-ASCII output (email, legacy systems, Content-Type you can't trust).
Every named characterthe five + every char with an HTML5 nameYou want the most human-readable entities across the whole HTML5 named set.

The five HTML/XML-sensitive characters are always encoded, whatever scope you pick — so the output is never unsafe to embed.

Choosing a format

Details worth knowing

Common entities

CharacterNamedDecimalHex
&&amp;&#38;&#x26;
<&lt;&#60;&#x3C;
>&gt;&#62;&#x3E;
"&quot;&#34;&#x22;
'&apos;&#39;&#x27;
©&copy;&#169;&#xA9;
&mdash;&#8212;&#x2014;
&euro;&#8364;&#x20AC;

FAQ

Is my text uploaded anywhere?

No. Encoding happens entirely in your browser with WebAssembly — your input never leaves your device, and the tool keeps working offline once the page has loaded.

Which characters does "Minimal" encode, and why only those?

Minimal encodes exactly the five characters HTML and XML treat as special: &, <, >, ", and '. Encoding just these makes any text safe to place inside markup without it being parsed as a tag, attribute, or entity — while leaving everything else readable.

What's the difference between named, decimal, and hex output?

They are three ways to write the same character. Named uses a keyword (&copy;), decimal uses the Unicode code point in base 10 (&#169;), and hex uses it in base 16 (&#xA9;). All three decode to the identical character in every browser; named is the most readable, numeric formats never need a fallback.

Why did an emoji become 😀 instead of a name?

Emoji and many symbols have no HTML5 named entity, so in named format the tool falls back to a decimal numeric reference (&#128512;). Choose decimal or hex format if you want every encoded character written numerically.

Does it re-encode text that already contains entities?

Yes. The tool encodes the literal characters it sees, so a stray & in an existing entity like & gets re-encoded to &amp;. Encode raw, un-encoded text once — don't run already-encoded HTML through it.

How do I turn entities back into normal characters?

Use the companion HTML Entity Decoder tool, which reverses every format this encoder produces — named, decimal, and hex references all decode back to the original text.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool html-entity-encoder "<b>Tom & Jerry's café</b> — €5"

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/html-entity-encoder/?text=%3Cb%3ETom%20%26%20Jerry%27s%20caf%C3%A9%3C%2Fb%3E%20%E2%80%94%20%E2%82%AC5&scope=minimal&format=named

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.