util·tools

HTML Entity Encoder & Decoder

Some characters — like the less-than sign, greater-than sign and ampersand — have special meaning in HTML, so to show them as plain text you replace them with safe codes called "entities". This tool encodes those characters into entities and decodes entities back into normal text. It runs in your browser.

About this html entity encoder & decoder

In HTML, a few characters are reserved: < and > mark tags and & begins a code, so to display them literally you swap them for HTML entities such as &lt;, &gt; and &amp;. Encoding does this for you, which is important whenever you put user text inside a web page, because it stops stray characters from breaking the layout or being read as code. Decoding does the reverse, turning entities — including numbered ones like &#39; and &#x41; — back into the characters they stand for. Both directions run entirely in your browser.

Frequently asked questions

What is an HTML entity?
It is a short code that stands for a character, like &amp;lt; for the less-than sign. Browsers display the character but treat the code as plain text.
Which characters get encoded?
The main reserved ones: < becomes &amp;lt;, > becomes &amp;gt;, &amp; becomes &amp;amp;, and the quote marks become &amp;quot; and &amp;#39;.
Can it decode number codes?
Yes. It handles named entities as well as numeric ones in both decimal (&amp;#39;) and hexadecimal (&amp;#x41;) form.

Related tools