Tools Hub

HTML Encode/Decode

Escape markup characters as HTML entities, or decode entities back to text.

Browser onlyYour data never leaves this device.

Runs entirely in your browser. Your text never leaves this device and is never stored.

Details: Privacy policy

Input

Conversion updates live. Nothing is stored.

Result

No text yet.

Paste text or HTML above.

HTML Encode/Decode converts between markup-significant characters and their entity forms, covering both the encode and escape direction people search for and the decode or unescape direction. Encoding replaces the five characters that can change how HTML is parsed - ampersand, less-than, greater-than, double quote and apostrophe - with named entities, and can optionally turn every non-ASCII code point into a numeric reference for a system that only accepts ASCII. Decoding does the reverse in a single pass, handling the common named entities plus decimal and hexadecimal numeric references, so an escaped ampersand becomes an ampersand again without a second round of decoding. The page is explicit about its scope. It is not a full HTML parser and not a complete entity table; an unknown named entity is left exactly as written rather than guessed at. Encoding text that already contains entities will escape their ampersands again, which is correct for raw text but usually not what someone pasting an existing entity wants, so the page says so. It is the tool for preparing text for an HTML attribute, reading escaped content from a database dump, and converting Unicode text for a legacy field. Everything runs locally in your browser. Numeric references are emitted in decimal, not hexadecimal. The optional non-ASCII pass runs after the five-character pass, so an entity's own ampersand is never double-encoded.

How to use HTML Encode/Decode

  1. Paste the text and choose encode or decode.
  2. For encoding, choose whether to convert all non-ASCII characters.
  3. Copy the result or clear to start over.

What you get

  • The text encoded as entities, or decoded back to characters.
  • A count of characters or entities that were replaced.
  • Unknown entities and untouched characters left exactly as they were.

When to use HTML Encode/Decode

  • Escape a phrase before placing it inside an HTML attribute or comment.
  • Decode entities in a database export so the text is readable again.
  • Convert non-ASCII text to numeric references for a legacy system.

Frequently asked questions about HTML Encode/Decode

Is HTML encoding the same as escaping?

Here, yes. The encode direction escapes the five markup-significant characters; the same page decodes them again. Both search terms lead to one tool rather than two competing pages.

Why did & become &?

Encoding treats the input as raw text, so the ampersand of an existing entity is escaped too. Decode first, or paste unescaped text.

Are all named entities supported?

No. The decoder handles common names plus numeric references. Unrecognised names are left as written instead of being replaced with a guess.

Is my text uploaded?

No. Conversion runs in your browser; nothing is sent to a server or stored.

⚡Embed HTML Encode/Decode on Your Site & Get Badge↓

Embed this in-browser tool into any blog, documentation, or dashboard. Includes an optional dofollow backlink badge to credit Tools Hub.

Height:
<iframe src="https://salaq.com/embed/text/html-encode-decode" title="HTML Encode/Decode — Tools Hub" width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden;max-width:100%;" loading="lazy"></iframe>
<p style="font-size:12px;color:#6b7280;margin-top:6px;font-family:system-ui,-apple-system,sans-serif;">Powered by <a href="https://salaq.com/tools/text/html-encode-decode" target="_blank" rel="noopener" style="color:#2563eb;text-decoration:underline;">HTML Encode/Decode on Tools Hub</a></p>

Feedback

Send feedback about this tool (placeholder — feedback collection is not wired up yet).