HTML Encoder / Decoder
Convert between plain text and HTML entities — instant, in-browser.
What are HTML entities?
HTML entities are special codes used to represent characters that have meaning in HTML syntax or that can't easily be typed. For example, < represents a literal less-than sign without the browser interpreting it as the start of an HTML tag. Entities start with & and end with ;.
Common entities
| Character | Entity | Description |
|---|---|---|
| < | < | Less-than (open tag) |
| > | > | Greater-than (close tag) |
| & | & | Ampersand |
| " | " | Double quote (in attributes) |
| ' | ' | Single quote / apostrophe |
| © | © | Copyright symbol |
| ® | ® | Registered trademark |
| — | — | Em dash |
Frequently asked questions
When do I need to encode HTML?
Whenever you want to display HTML code as text inside an HTML page — for example in a <pre> block showing sample markup, or when passing HTML as a string in a JSON API response. Without encoding, browsers would interpret the characters as actual tags.
Does this tool prevent XSS?
HTML encoding the five core characters (< > & " ') is the primary defence against reflected and stored XSS when inserting user input into HTML. Always encode user-supplied content before rendering it in the DOM.
What is the difference between named and numeric entities?
Named entities like © are human-readable. Numeric entities like © (decimal) or © (hex) reference the Unicode code point directly. Both render identically in browsers. This decoder handles all three forms.
