HTML Encode

Convert raw text into HTML-safe encoded output. Supports named, decimal, and hexadecimal entities. Runs entirely in your browser — no data is ever sent to a server.

0 characters

Type or paste raw text here to encode it into HTML-safe entities

Format:
0 entities encoded

This is the HTML-encoded version of your input. Copy to use elsewhere.

About HTML Encoding

HTML encoding converts characters with special meaning in HTML into safe entity representations. This prevents browsers from interpreting your content as markup, which is critical for security and correctness.

The Five Critical Characters

Five characters are particularly important to encode in HTML:

  • & (ampersand) — starts an entity reference
  • < (less-than) — opens an HTML tag
  • > (greater-than) — closes an HTML tag
  • " (double quote) — delimits attribute values
  • ' (single quote) — delimits attribute values in some contexts

Named vs Numeric Entities

Named entities like &lt; are the most readable and widely used. Decimal numeric entities like &#60; and hexadecimal numeric entities like &#x3C; are supported universally across all HTML parsers and are useful in contexts where named entities may not be recognised.

XSS Prevention

Cross-Site Scripting (XSS) attacks inject malicious scripts into web pages by exploiting unencoded user-supplied content. Encoding user data before inserting it into HTML output is one of the most effective defences against XSS — it neutralises scripts by turning <script> into &lt;script&gt;, which browsers render as text rather than executing as code.

Code Cultivation • © 2026