Sign up free

Encode and Decode HTML Entities Online

Turn text into HTML entities (named, decimal or hex), or decode entities back into readable text.

About HTML Entity Encoder/Decoder

Turn text into HTML entities when it has to go into HTML without being read as markup: a code sample in a blog post, a product name with an ampersand in a template, a visitor's comment you're about to show on a page, or a value in an XML or RSS feed. By default only the five special characters & < > " and ' are escaped, which is all a page needs to show them as text.

Choose to encode every non-ASCII character as well, and 你 becomes &#20320; as a decimal entity or &#x4F60; in hex, useful for old systems and email templates that mangle UTF-8. Named entities such as &copy; are the third style. Decoding understands any named or numeric entity, so &nbsp;, &quot; and &#39; in scraped or exported text turn back into ordinary characters. Everything runs in your browser and nothing is uploaded.

How to use HTML Entity Encoder/Decoder

  1. 1
    Pick the direction

    Encode text into entities, or decode entities back into text.

  2. 2
    Set what to escape

    Only the five special characters, or every non-ASCII character too.

  3. 3
    Choose the entity style

    Named, decimal or hex. In decimal 你 is &#20320;, in hex &#x4F60;.

  4. 4
    Copy the result

    Paste it into your template, post or feed.

Why use Cubfile for this

  • Two levels of escaping

    Just & < > " and ', or every character outside ASCII, including Chinese and emoji.

  • Named, decimal or hex

    Choose names like &copy; or numeric codes like &#20320; and &#x4F60;.

  • Decodes any entity

    Named and numeric entities, decimal or hex, all turn back into characters.

  • Private and offline

    Runs in your browser, uploads nothing and keeps working offline once loaded.

FAQ

HTML Entity Encoder/Decoder: questions and answers

What does an HTML entity encoder do?
It replaces characters that mean something in HTML, such as < and &, with codes like &lt; and &amp;. The browser then shows them as text instead of reading them as tags.
Which characters must be escaped in HTML?
The ampersand and the less-than sign always, the greater-than sign to be safe, and double or single quotes inside attribute values. The default mode escapes exactly these five.
Should I use named, decimal or hex entities?
They look the same on the page. Named ones like &copy; are easier to read, while numeric ones like &#20320; exist for every character and also work in XML and RSS, which don't know most HTML names. The same characters can be written as \u escapes or U+ code points with the Unicode Converter.
Why does my page show &amp; instead of &?
The text was escaped twice, so the source contains &amp;amp;. Decode it once here to confirm, then fix the template or plugin so it escapes only once.
Is my text uploaded when I encode or decode HTML entities?
No. Encoding and decoding run in your browser, nothing is sent to us, and there's no daily limit. The other encoding and encryption tools work the same way, on your device.
Share HTML Entity Encoder/Decoder with a friendIt runs in any browser, and they can try it without signing up.

Related tools

HASH Hash GeneratorGet MD5, SHA-1, SHA-256, SHA-512 and SM3 hashes of text in one go.
TIME Unix Timestamp ConverterConvert Unix timestamps to dates and back, in your time zone and UTC.
U+UNI Unicode ConverterConvert text to and from \u escapes, &#; codes, U+ points and UTF-8 bytes.
AES AES Encrypt and DecryptEncrypt or decrypt text with AES in GCM, CBC or CTR mode.
JWT JWT DecoderDecode a JSON Web Token’s header and payload and check its expiry and signature.
01BIN Number Base ConverterConvert numbers between binary, octal, decimal, hex and any base up to 36.
BASE Base32 and Base58 EncoderEncode and decode Base32, Base58, Base85 and Base16.
0xHEX Text to Hex ConverterTurn text into hexadecimal bytes in UTF-8, GBK or UTF-16, and back.