All tools

HTML Encoder / Decoder

Convert between plain text and HTML entities — instant, in-browser.

85 chars

What are HTML entities?

HTML entities are special codes used to represent characters that have meaning in HTML syntax or that can't easily be typed. For example, < represents a literal less-than sign without the browser interpreting it as the start of an HTML tag. Entities start with & and end with ;.

Common entities

CharacterEntityDescription
<&lt;Less-than (open tag)
>&gt;Greater-than (close tag)
&&amp;Ampersand
"&quot;Double quote (in attributes)
'&#39;Single quote / apostrophe
©&copy;Copyright symbol
®&reg;Registered trademark
&mdash;Em dash

Frequently asked questions

When do I need to encode HTML?

Whenever you want to display HTML code as text inside an HTML page — for example in a <pre> block showing sample markup, or when passing HTML as a string in a JSON API response. Without encoding, browsers would interpret the characters as actual tags.

Does this tool prevent XSS?

HTML encoding the five core characters (< > & " ') is the primary defence against reflected and stored XSS when inserting user input into HTML. Always encode user-supplied content before rendering it in the DOM.

What is the difference between named and numeric entities?

Named entities like &copy; are human-readable. Numeric entities like &#169; (decimal) or &#xa9; (hex) reference the Unicode code point directly. Both render identically in browsers. This decoder handles all three forms.

Page share preview

More free image tools