Developer Tools
HTML Entity Encoder and Decoder
Escape & < > and quotes as &, < and ", or turn £ and © into £ or ©. Decodes 250+ named entities and every numeric entity.
How to use HTML Entity Encoder and Decoder
Paste HTML or plain text and choose Encode or Decode. When encoding, pick which characters to convert and the entity style; the result updates as you type and reports how many characters or entities were converted.
- Paste HTML or textEnter a code snippet or user text to escape, or text full of entities such as £ and £ to decode.
- Set scope and styleChoose special characters only, all non-ASCII, or every character, then named (©), hex (©) or decimal (©).
- Copy the outputUntick Encode quotes for body text, then copy the result. In decode mode any unrecognised entities are listed.
Choosing what to encode
The default scope converts only the five characters that matter in HTML markup: & < > and both quote marks, giving &, <, >, " and '. That is enough for showing code samples or user input safely on a page; untick Encode quotes if the text is not going inside an attribute value. Special characters + all non-ASCII also converts symbols and accented letters, so £ becomes £ and © becomes © in the named style, or £ and © in hex. Every character except whitespace turns letters into entities too: a@b.com becomes a@b.com in decimal.
How entities are decoded
Decoding recognises more than 250 common named entities, from & and to —, … and the Greek letters, plus every decimal and hexadecimal numeric form such as £ and £. As the HTML standard requires, numbers 128 to 159 are read as Windows-1252, so – becomes an en dash (–), and invalid code points become �. In the browser the remaining HTML5 named entities are recognised as well. Anything still unknown, such as a misspelt &foo;, is left exactly as it is and listed in a warning so you can fix it.
Accuracy and data handling
Validate the result with your project's own tests and runtime rules before using it in production. The calculation runs in your current browser; the tool code does not send the input to a processing API.
FAQ
What is the difference between ' and '?
Both mean a single quote. ' was not part of HTML 4, so the encoder writes the more widely supported ', while the decoder understands both.
Do I need to encode accented letters or £ signs?
Not if the page is served as UTF-8, as almost all are. Convert them only when the output must be pure ASCII, for example in some email templates or older systems.
Why was an entity not decoded?
It may be misspelt, missing its closing semicolon, or not a real HTML entity. The decoder leaves such sequences unchanged and lists them so you can check each one.
More Developer Tools
Related toolsDecode a JWT's header and payload, check expiry and verify the signature
Convert YAML to JSON and back, with anchors, merge keys and multiple documents
Beautify messy SQL clause by clause or squeeze it onto a single line
Pretty-print or minify XML and pinpoint errors by line and column
Convert between binary, octal, decimal, hex and bases 2–36, even for huge numbers
Turn text into ASCII codes, or decode decimal, hex and binary codes to text