The quick answer

HTML entities swap the characters HTML treats as syntax for safe stand-ins: & becomes &amp;, < becomes &lt;. This tool encodes eight such characters (including =, / and the backtick, the extra three that attribute contexts care about) and decodes decimal numeric references plus 16 common named entities, live in the browser, with a refresh wiping everything you pasted.

The problem HTML entities solve

HTML gives a handful of characters day jobs other than being text: < opens a tag, > closes it, & opens an entity, and the quotes have strong opinions inside attributes. When your content must display those characters literally, a code sample, an AT&T trademark, a comparison operator, entity encoding swaps each one for a safe stand-in that the browser renders back exactly as intended.

In the wild you will meet three spellings: named references like &amp; and &lt;, decimal numeric references like &#169; for ©, and hex references like &#xA9; for the same character, since 169 decimal and A9 hex are the same code point U+00A9. This tool encodes the eight syntax characters to named or decimal forms, decodes decimal references and 16 named ones back, and leaves everything else as it finds it. Both directions run live in this tab; nothing you paste is uploaded, stored or logged.

What HTML entity encoding is

The HTML Entity Encoder/Decoder is a browser utility for converting text between literal characters and entity references, instantly and reversibly, on your device. Browser-based is the important part: the computation runs on your machine using JavaScript, so your data is never uploaded to a server, never stored, and never seen by anyone but you. That is a structural guarantee, not a policy promise; there is no network request to intercept.

In practice you use it like any instant tool: paste data, pick the direction with the Encode or Decode button, and the conversion appears live in the output panel, with no calculate button to press and no page reload between input and answer. When you are done, close the tab and everything you entered is gone.

The tool belongs to the encoding cluster, and it pairs naturally with the Base64 Encoder/Decoder and URL Encoder/Decoder, tools built to chain together in real workflows rather than live as isolated one-offs.

Encoding or decoding, step by step

Here is the complete workflow, from empty input to a result you can copy and trust.

  1. Load the example or paste your own data

    The Load example button fills the input with a sample HTML snippet whose tags, quotes, ampersand and equals sign all come back escaped; otherwise paste your own. The tool computes live as you type.

  2. Pick Encode or Decode

    Two buttons under the panels switch the direction. Encode escapes the eight syntax characters; Decode resolves decimal numeric references and the 16 named entities in the engine's table.

  3. Review the output panel

    The output updates on every keystroke and every mode change, so a wrong direction is visible the moment it happens.

  4. Copy, download or continue

    Copy puts the result on your clipboard; Download writes it as encoded.txt; and Use as input pipes the output straight back for the reverse direction, which is the fastest round-trip check there is.

  5. Clear when done

    Clear wipes the input instantly. Because processing is local, there is no history, no server copy and no residue.

Nothing on this page needs to be studied first; the tool works on arrival, and the documentation underneath is reference, not homework.

The eight characters the encoder escapes

The encoder's escape set is the extended one that attribute contexts want: the four classic markup characters plus the four extras that make attribute injection harder. Each occurrence is replaced by exactly one reference:

CharacterEncoded asForm
&&amp;named
<&lt;named
>&gt;named
"&quot;named
'&#39;decimal
`&#96;decimal
=&#61;decimal
/&#47;decimal

Everything else, including accented letters and CJK text, passes through the encoder unchanged: entities for non-ASCII characters exist in HTML, but this engine only escapes the eight characters above, which keeps output readable and diffs small.

Decode runs a two-pass table. First every decimal numeric reference &#NNN; resolves to its Unicode code point, so &#169; becomes © and &#232; becomes è. Then 16 named entities resolve: amp, lt, gt, quot, apos, nbsp, copy, reg, trade, hellip, mdash, ndash, lsquo, rsquo, ldquo and rdquo. Hex references like &#xA9; and unlisted names like &eacute; pass through untouched, and there is no greedy matching: a name without its semicolon stays as it is, so browser surprises like &notit rendering as ¬it cannot happen here, the string simply survives unchanged.

Worked examples you can paste in

The examples below were produced by the engine's own code path, so auditing them is literally testing the tool.

Encode: the built-in sample snippet

Input

<div class="hero">Tom & Jerry's "adventure"</div>

Output

&lt;div class&#61;&quot;hero&quot;&gt;Tom &amp; Jerry&#39;s &quot;adventure&quot;&lt;&#47;div&gt;
Decode: decimal references and named entities

Input

Tom &amp; Jerry &quot;run&quot; &#39;fast&#39; &#169; 2027

Output

Tom & Jerry "run" 'fast' © 2027
Decode: what passes through untouched

Input

caf&eacute; &amp; cr&#232;me &#x41;

Output

caf&eacute; & crème &#x41;

Read the third example as the engine's honest boundary: &amp; and the decimal reference &#232; resolved, while &eacute; (not one of the 16 names) and the hex reference &#x41; survived untouched. The round trip is exact for everything the table covers and conservative for everything it does not.

Who reaches for an entity encoder

Front-end developers and template authors render user-entered content safely by neutralizing < and & before they reach the DOM. Encoding a display name or README excerpt here is the fastest manual check that the escaping your framework promised is actually running in every output slot.

Technical writers and support staff meet the opposite problem: a doc that must show a snippet literally, a CMS that eats angle brackets, a colleague's over-escaped paste. Encode the sample so it renders as text; decode to recover the original.

What the tool guarantees

AspectThis tool
Processing100% client-side, JavaScript in your browser
Signup requiredNo, no account, no email, no cookies for consent-free use
Data uploadedNever; inputs stay on your device by architecture
SpeedLive recomputation on every keystroke
Mobile supportFull, responsive two-panel layout with touch-friendly buttons
Offline useWorks after first load; the engine has no live-data feature
CostFree, no usage meter

Your markup never leaves the browser

The content people bring here is unfinished work: draft pages, unpublished pricing, code snippets from products still in development. The conversion happens in this tab, no request exists to intercept, and the page keeps working with your Wi-Fi switched off. There is no server-side log because there is no server-side anything.

Compared with escaping functions and libraries

You have options for entity work. Here is how the mainstream alternatives stack up, including where they legitimately win.

AlternativeWhy people pick HTML Entity Encoder/Decoder instead
Language functions (html.escape, HE.encode)What production code calls; the tab is for one-off strings, logs and CMS fields where you cannot run code
Server-side encodersDraft markup and unpublished content never cross the network; no request exists to log
Find-and-replace in an editorEight reserved characters need eight passes and misses everything you forgot; encoding is one table lookup

The comparison concedes its losses: at batch scale, a scripted pipeline beats a browser tab, and the table does not hide it.

Field notes and gotchas

When something behaves unexpectedly, the causes are almost always one of these:

  • Decoded text still shows &eacute; or &#xA9;: the decode table covers decimal references and 16 named entities; hex forms and unlisted names pass through by design, not by failure.
  • Encoded output looks unchanged for accented text: only the eight syntax characters are escaped, so é and ü survive as themselves, which is intended.
  • A name without its semicolon stays literal: the engine never greedy-matches, so &notit survives decoding here even though a browser would render it as ¬it.

The distilled usage advice: load the example first to validate your understanding in ten seconds, and use the Use-as-input button for the fastest round-trip check. If something still does not behave, the contact page reaches the engineers directly.

Frequently asked questions

These are the questions people actually search about the html entity encoder, answered directly. If yours is missing, the contact page takes feature and question requests.

What is the difference between named and numeric entities?

Named entities are words, &amp; for &, and HTML5 defines roughly 2,200 of them. Numeric entities address any Unicode code point directly: &#169; in decimal or &#xA9; in hex both render © in a browser. This tool encodes to named forms for four characters and decimal forms for the other four, and it decodes decimal references plus 16 named ones; hex forms pass through unchanged.

Is the HTML Entity Encoder/Decoder free to use?

Yes, and free means free: no signup, no email gate and no usage meter. Everything runs on your machine after the page loads, so usage does not scale anyone's hosting bill. The only limit is the one your browser itself imposes.

Why did &eacute; and &#xA9; come back unchanged after decoding?

The decode table is deliberately small: decimal numeric references of any code point, plus 16 named entities (amp, lt, gt, quot, apos, nbsp, copy, reg, trade, hellip, mdash, ndash, lsquo, rsquo, ldquo, rdquo). Anything else, including hex references and unlisted names like eacute, passes through untouched rather than being guessed at.

Is HTML entity encoding the same as URL encoding?

No. Entities like &amp; make characters safe to display in HTML and XML documents; URL percent-encoding like %26 makes bytes safe inside a URL. Same spirit, different media, and neither is encryption since both reverse without any key. The URL Encoder/Decoder in this cluster handles the other half of that sentence.

Do entities protect me from XSS or SQL injection?

They help with display only. Encoding < as &lt; stops a snippet from executing as markup, which is genuine XSS defense in HTML output contexts. But SQL injection lives in an entirely different context and needs parameterized queries, and attribute contexts need their own quoting rules. Entities are one correct layer, never the whole answer.

Can I use the HTML Entity Encoder/Decoder offline?

Yes. The engine is bundled with the page, so a cached copy keeps working without a connection; there is no live-data feature on this tool that would hold anything back.

Does the HTML Entity Encoder/Decoder work on mobile?

Yes. The tool ships as a responsive web page: mobile visitors get the full two-panel form with the same Encode and Decode buttons, and there is no app to download or account to create.

Do you store what I enter into the HTML Entity Encoder/Decoder?

No uploads, no logging, no retention: the encoding happens in your browser's memory with plain JavaScript. When the tab closes, your data closes with it.

Neighbouring tools in the encoding cluster

  • Base64 Encoder/Decoder takes the same two-panel instant form for binary-safe text transfer.
  • URL Encoder/Decoder does the percent-encoding for URLs, the other half of the escaping pair.
  • Hex to String Converter is the detour when the debugging trail leads through hex instead of entities.
  • Strip HTML Tags is the cleanup partner when decoded markup needs to lose its tags entirely.

The takeaway

The fastest trustworthy entity converter on the web: instant because it is local, trustworthy because the eight-character escape set and the 16-name decode table are printed on this page with worked examples that are the engine's own output, and private because there is no server in the loop. Put it through its paces with real work, then tell the team what broke.

Sources and further reading

We cite primary sources (standards bodies, government agencies, official documentation) wherever they exist so you can verify every number on this page yourself.