Web Utilities

HTML Entity Encoder / Decoder

Encode special characters to HTML entities or decode entities back to readable text. Supports named, numeric, and extended character entities.

Entities:
Plain HTML / Text
0 chars
Encoded Entities
0 chars

HTML Entities Explained

HTML entities are character sequences that replace reserved characters in HTML. By replacing tags like < and > with their entity equivalents (&lt; and &gt;), you prevent browsers from mistakenly treating text as HTML code strings. This is a fundamental technique for preventing Cross-Site Scripting (XSS) attacks.

Named vs. Numeric

Named entities are easy to read and remember (e.g., &copy; for ©). Numeric entities use the character's exact Unicode position, formatted either as decimals (&#169;) or hexadecimals (&#xA9;). Numeric entities are advantageous because they cover every character in the Unicode specification, whereas named entities only exist for the most common symbols.

UTF-8 and Non-ASCII Characters

If your HTML document is properly encoded as UTF-8 (using the <meta charset="UTF-8"> tag), you rarely need to encode non-ASCII characters like emojis or foreign alphabets. You only inherently need to encode the five reserved HTML characters: <, >, &, ", and '.