Home / Tools / HTML entity encoder and decoder

HTML Entity Encoder and Decoder: Escape and Unescape HTML Online

Encode special characters as HTML entities (< & ") or decode entities back to text. Optionally encode every non-ASCII character. Runs in your browser.

Paste text and choose Encode to replace characters such as <, >, & and quotes with HTML entities, or Decode to turn entities such as &amp; and &#169; back into characters.

    What it does

    Example

    Before

    <a href="x?a=1&b=2">Tom & Jerry's</a>

    After

    &lt;a href=&quot;x?a=1&amp;b=2&quot;&gt;Tom &amp; Jerry&#39;s&lt;/a&gt;

    Frequently asked questions

    Does encoding make user input safe?
    Encoding text before putting it in an HTML page prevents it from being read as tags. It is one part of safe output; the right escaping depends on where the text goes (HTML body, attribute, script or URL).
    Why encode non-ASCII characters?
    Only needed for old systems or pages without a UTF-8 declaration. Modern pages should use UTF-8 and plain characters.
    Does decoding run any script?
    No. Decoding only converts entities to text and never runs HTML.
    Is my text uploaded?
    No. It stays in your browser.

    Runs in your browser. Nothing you type is sent to this site. Updated 2026-10-11.

    More tools

    Code formatters

    CSS beautifier CSS minifier HTML beautifier HTML minifier JavaScript beautifier JavaScript minifier JSON formatter YAML formatter XML formatter SQL formatter Markdown preview

    Converters

    Base64 encoder and decoder URL encoder and decoder Unix timestamp converter CSV to JSON JSON to CSV Number base converter Time zone converter JSON to TypeScript XML to JSON HTML to Markdown Date difference calculator

    Text tools

    Regex tester Remove duplicate lines Lorem ipsum generator Word counter Case converter Text diff checker

    Color and images

    Color converter Contrast checker Image to Base64 Image resizer

    Network

    Subnet calculator Download time calculator Common ports list CIDR to IP range IPv6 address expander and compressor MAC address formatter curl command builder

    Server and files

    Cron expression explainer chmod calculator HTTP status codes

    Encoding and security

    Password generator UUID generator Hash generator JWT decoder QR code generator Password strength checker Wi-Fi QR code generator