HTML Entity Encoder / Decoder

Encode HTML-sensitive characters into HTML entities or decode HTML entities back into readable text. Supports common special characters and browser-supported named and numeric character references.

Conversion

Text Input

Enter text containing special characters to encode.

About HTML Entities

HTML entities represent special characters using character references. They are commonly used for characters such as angle brackets, ampersands and quotation marks in HTML text and attributes.

Encode

< → &lt;& → &amp;

Decode

&lt; → <&amp; → &

This tool processes text in your browser and does not send the input to a server.

About HTML Entity Encoder / Decoder

Convert HTML-sensitive characters into HTML entities or decode HTML character references into readable text. Use the encoder for common HTML characters and the decoder for named and numeric character references supported by your browser.

How to Use HTML Entity Encoder / Decoder

Choose Encode or Decode, enter your text or HTML entities, and click the conversion button. The result appears below the input area. Use Copy to copy the converted text, or Clear to reset the tool.

What Are HTML Entities?

HTML entities, also called character references, represent characters using a specific text sequence. Named references begin with an ampersand and usually end with a semicolon. Numeric references use a number to identify a Unicode character.

HTML Encoding and Decoding

Encoding converts five commonly used HTML-sensitive characters into their corresponding entity representations: ampersand, less-than sign, greater-than sign, double quotation mark and apostrophe. Decoding converts HTML character references back into their corresponding characters.

Common HTML Entities

CharacterHTML EntityDescription
<&lt;Less-than sign
>&gt;Greater-than sign
&&amp;Ampersand
"&quot;Double quotation mark
'&#39;Apostrophe

HTML Entity Conversion Examples

For example, the following HTML text contains several special characters:

Original Text

<p title="Tom's">Hello & Welcome</p>

Encoded HTML

&lt;p title=&quot;Tom&#39;s&quot;&gt;Hello &amp; Welcome&lt;/p&gt;

Supported Input and Limitations

The encoder converts five HTML-sensitive characters: ampersand (&), less-than sign (<), greater-than sign (>), double quotation mark and apostrophe. Other characters, including ordinary Unicode text, are left unchanged by the encoder.

The decoder uses the browser's HTML character-reference parsing behavior. It supports named and numeric references recognized by the browser. Invalid or unrecognized references may remain unchanged rather than producing a conversion error.

The input limit is 100,000 characters. The tool converts text only and does not process HTML files.

HTML Entity Encoding and Security

Encoding special characters can help represent text correctly in HTML. However, entity encoding alone is not a complete HTML security solution. The correct escaping method depends on where the data will be used, such as HTML text, an attribute, JavaScript or a URL. Use appropriate context-specific escaping and HTML sanitization when handling untrusted content.

Why Use an HTML Entity Encoder / Decoder?

HTML entity conversion is useful when working with HTML source code, web templates, documentation, frontend development and text processing. It provides a convenient way to convert common special characters without manually replacing each character reference.

Your privacy matters

We use optional analytics cookies to understand how our tools are used and improve your experience. These controls apply to Google Analytics only, not advertising preferences. Privacy Policy