HTML Entity Encoder & Decoder
Type in either box to turn text into HTML entities, or decode < & 中 and other entities back into text. All named entities supported.
How to Use
- Type or paste text into the top box and the HTML entities appear in the bottom box. By default only the five characters that mean something in HTML, < > & " and ', are converted. Everything else is left as it is.
- To put text into a system that only handles ASCII, tick “Also encode non-ASCII characters”: CJK, accents, and emoji become hex numeric entities such as 中, with one entity per emoji.
- Paste entities into the bottom box to decode them in the top box. There's no encode or decode button to pick. Named (©), decimal (©), and hex (©) entities all work, and names are case-sensitive just like in the standard.
- If something is wrong, the box with the problem shows which character it is and why, and the other box keeps its last good result. “Select the problem” highlights that part for you.
- A lone & isn't treated as an entity, so AT&T, R&D, and &lang=en in a URL stay as they are. Only text written like &name; or &#number; gets checked.
- “Swap” moves the result into the box you typed in. “Clear” empties both boxes.
FAQ
What are HTML entities and why use them?
An HTML entity is a way to write one character as text that starts with & and ends with ;, for example < for <, & for &, and © for ©. Since < and & have special meaning in HTML, you must write them as entities to show them as plain text on a page, otherwise the browser treats them as the start of a tag or entity. Converting user-provided text to entities before putting it in a page is also one of the basic defenses against XSS.
Are HTML entities a form of encryption?
No. HTML entities are an encoding: a public rule that rewrites characters, with no key, so anyone can turn them back into the original text. They hide nothing. To protect content, use real encryption.
What's the difference between named, decimal, and hex entities?
All three point at the same character: ©, ©, and © are all ©. Named entities are easy to read, but only about two thousand characters listed in the HTML standard have a name. Numeric entities can express any Unicode character, and the hex number is the familiar U+ code point. This tool writes hex when encoding and understands all three when decoding.
Why is the single quote encoded as ' instead of '?
' exists in XML and HTML5, but HTML 4 and some older systems don't know it and show it as literal text. ' works everywhere, so it's the default. When decoding, both forms are understood.
What does it mean when decoding says an entity is “incomplete” or “not a standard name”?
The part starting with & looks like an entity but is written wrong. Typical causes are a missing closing ; (& or A), nothing after &#, or a misspelled or wrongly capitalized name (named entities are case-sensitive, so Á and á are different letters). A number can't be 0, above 10FFFF (hex), or between D800 and DFFF. The message points at the position, and once it's fixed the other box updates.
Related Tools
Unicode Escape Encoder & Decoder
Type in either box to turn text into \uXXXX, \u{…}, &#x…;, or U+XXXX, or decode any mix of Unicode escapes back into text.
URL Encoder & Decoder
Type in either box to percent-encode text for a URL, or decode %20-style sequences back into readable text.
Base64 Encoder & Decoder
Type in either box to encode text as Base64 or decode Base64 back into text. UTF-8 safe, with a URL-safe alphabet option.
JSON to YAML Converter
Paste into either box to convert JSON to YAML or YAML back to JSON. Big numbers stay exact, and every lost detail gets its own warning.
Base Converter
Type in any field to convert between bases 2, 8, 10, 16, and any base from 2 to 36, with big numbers, negatives, repeating fractions, and two's complement.
Text to Binary & Hex Converter
Type in either box to turn text into the binary, octal, decimal, and hex of each UTF-8 byte, or decode those bytes back into text.
Morse Code Translator
Type in either box to turn text into Morse code or decode dots and dashes back into text, then play it as sound at the speed you choose. Includes Japanese Wabun.
Special Symbols
Stars, arrows, hearts, music notes, circled numbers and more special symbols. Search by name or browse by category, then tap to copy.