HTML Entities Encoder & Decoder

Encode special characters into HTML entities and decode them back — in your browser.

How to use

  1. Paste your text or HTML snippet in the input field — code samples, accented text, symbols, anything.
  2. Click "Encode" to turn &, <, >, " and ' into entities (check the box to also convert every non-ASCII character to numeric form), or "Decode" to translate entities back into plain characters.
  3. Copy or download the result. Everything runs in your browser — nothing is sent to any server.

About this tool

HTML entities are the escape mechanism of the web: sequences like &amp;, &lt; and &#233; that let a page display characters which would otherwise be interpreted as markup or be unavailable in the document's encoding. Whenever you need to show a code sample inside a page, put user text into an attribute, or paste content into a system that mangles accents and symbols, encoding is the answer — and when you receive text full of &nbsp; and &#39; from a scraper, a feed or a database dump, decoding brings it back to readable characters.

The encoder always converts the five characters that matter for safety and correctness — &, <, >, double and single quotes — replacing the apostrophe with the numeric form &#39; because the named &apos; is not defined in HTML 4. An optional checkbox additionally converts every character above the ASCII range into a numeric entity (&#233; for é, &#128512; for 😀), correctly pairing surrogate halves so emoji become a single code point instead of two broken numbers. The decoder works in the other direction with an embedded table of the roughly 250 named entities of the HTML 4 standard — from &nbsp; and &copy; to Greek letters and arrows — plus every numeric entity in decimal (&#233;) or hexadecimal (&#x1F600;) form.

Rarer HTML5 names outside the table are resolved through a detached browser element, so practically any valid entity decodes correctly, while malformed or impossible sequences (like surrogate code points) are left untouched instead of being corrupted. The status line tells you exactly how many replacements were made, which is a quick sanity check when cleaning large blocks of text. Everything happens locally in JavaScript: your content is never uploaded, logged or stored anywhere.

Frequently asked questions

When should I encode characters as HTML entities?

Encode whenever text will be placed inside HTML and must not be interpreted as markup: code examples on a page, user input echoed into attributes, or symbols that break in legacy encodings. The five critical characters are &, <, >, " and '.

What is the difference between named and numeric entities?

Named entities use a mnemonic (&copy; for ©) and only exist for a fixed list of characters; numeric entities reference any Unicode code point directly, in decimal (&#169;) or hexadecimal (&#xA9;). Browsers treat them identically.

Why does the encoder output &#39; instead of &apos;?

Because &apos; is not part of HTML 4, so very old parsers and some e-mail clients do not understand it. The numeric form &#39; renders the apostrophe everywhere, which is why it is the safe convention.

Does the decoder handle emoji and hexadecimal entities?

Yes. It decodes decimal and hexadecimal numeric entities across the full Unicode range, including astral characters like &#x1F600; (😀), and rebuilds them as proper surrogate pairs in JavaScript strings.

Does my text leave my browser?

No. Encoding and decoding run 100% in JavaScript on your device. Nothing is transmitted, logged or stored on any server.

Related tools

Long links? Shorten them for free

Vai.la turns any URL into a short link with click statistics, QR Code and your own biolink.

Vai.la is not responsible for how the tools are used or for decisions made based on their results.