HTML Encoder/Decoder
Convert text to HTML entities and decode HTML entities back to text with this simple online tool.
Encoding Options
Input Text
0 characters
About HTML Encoding/Decoding
HTML encoding converts special characters into HTML entities to ensure they display correctly in web browsers. This is essential for displaying characters that have special meaning in HTML syntax.
HTML entities begin with an ampersand (&) and end with a semicolon (;). They can be represented by entity names (like <) or entity numbers (like <).
Common HTML entities:
Character | Entity Name | Entity Number | Description |
---|---|---|---|
< | < | < | Less than |
> | > | > | Greater than |
& | & | & | Ampersand |
" | " | " | Double quote |
' | ' | ' | Apostrophe |
Why use HTML encoding?
- To display special characters that have meaning in HTML syntax
- To prevent XSS (Cross-Site Scripting) attacks by encoding user input
- To ensure proper display of international characters
- To include symbols and special characters in HTML content
Examples of HTML encoding:
HTML tags: "<div>Hello</div>" → "<div>Hello</div>"
Special characters: "Price: $50 & Tax: $5" → "Price: $50 & Tax: $5"
Quotes: "He said, \"Hello!\"" → "He said, "Hello!""