HTML Entities Encoder & Decoder

Convert reserved and special characters into HTML entities (such as <, >, and &) or decode entities back to plain text.

Plain Characters / HTML
HTML Entities
Copied to clipboard!

Encode & Decode HTML Entities Online

In HTML syntax, certain characters are reserved for markup structure. For instance, the less-than symbol (<) signals the opening of a tag, while the ampersand (&) indicates the start of an entity reference. If you want these symbols to display as visible text on a webpage rather than being interpreted by the browser as code, they must be converted into their corresponding HTML entities.

Named Entities vs. Numeric Character References

  • Named Entities: Easy-to-remember mnemonics preceded by an ampersand and terminated with a semicolon, such as &lt; for <, &gt; for >, and &amp; for &.
  • Decimal References: Numeric representations corresponding to the character's Unicode code point, such as &#60; for <.
  • Hexadecimal References: Hex-encoded representations of the Unicode code point, such as &#x3C; for <.

Essential HTML Reserved Characters

SymbolNamed EntityDecimal EntityDescription
&&amp;&#38;Ampersand symbol
<&lt;&#60;Less-than sign (opening HTML tag)
>&gt;&#62;Greater-than sign (closing HTML tag)
"&quot;&#34;Double quotation mark
'&apos;&#39;Single quotation mark (apostrophe)
©&copy;&#169;Copyright symbol
™&trade;&#8482;Trademark symbol

Why Escaping HTML is Critical

  • Displaying Code Snippets: Whenever you publish code tutorials, programming blogs, or documentation, wrapping raw HTML in &lt; and &gt; entities allows code to display safely inside <pre><code> tags without executing.
  • Preventing XSS Vulnerabilities: Rendering unescaped user input in web browsers creates Cross-Site Scripting (XSS) risks. Converting user text to HTML entities defangs potentially malicious script tags.

Related Web & Text Utilities

Explore more text processing and encoding tools: