About the HTML Encoder/Decoder
The HTML Encoder/Decoder switches text between raw characters and HTML entities. Encode turns markup-sensitive characters into safe entities so they display as text, and Decode turns entities like & or © back into the characters they stand for.
How it works
Encode always replaces the five special characters: & becomes &, < becomes <, > becomes >, a double quote becomes " and an apostrophe becomes '. With Also non-ASCII, every character beyond basic ASCII (accents, symbols, emoji) is encoded too, and Every character encodes all non-whitespace characters. Common characters such as © and — get named entities in Named style; everything else uses decimal or hex numeric entities.
Decode uses the browser's own HTML parser: the text is placed into a hidden textarea element as HTML and read back as plain text. That means every entity the browser knows is decoded, including named ones like © and é, and numeric ones like € or €.
How to use
- 1
Choose Encode or Decode.
- 2
Paste your HTML or entity-filled text into the box.
- 3
When encoding, choose what to encode and the entity style.
- 4
Review the result and click Copy.
Worked examples
Showing code on a page
Displaying a link tag inside a tutorial.
Decoding a feed title
Cleaning text from an RSS feed.
Frequently asked questions
Why would I need to encode text for HTML?+
Characters like < and > start and end tags, so encoding them as < and > makes the browser display them as text instead of treating them as markup.
What does & mean?+
It is the HTML entity for an ampersand. The & must be escaped because it starts every other entity.
Does Encode convert accented letters like é?+
Only if you choose Also non-ASCII or Every character. By default only &, <, >, " and ' are converted, because accented letters are valid as-is in UTF-8 pages.
Which entities can Decode handle?+
Any entity the browser recognizes, including named entities like © and numeric ones like © or ©.