HTML Entity Encoder/Decoder
Encode text to HTML entities or decode HTML entities to text instantly.
What are HTML Entities?
HTML entities are special codes used to represent characters that have special meaning in HTML or characters that cannot be easily typed on a keyboard. They allow you to display characters like <, >, &, and quotes in HTML without breaking the HTML structure.
Common HTML Entities
- & - Ampersand (&)
- < - Less than (<)
- > - Greater than (>)
- " - Double quote (")
- ' - Single quote/apostrophe (')
- - Non-breaking space
When to Use HTML Entities
- XSS Prevention: Encode user input to prevent cross-site scripting attacks when displaying user-generated content
- Displaying Special Characters: Show characters like <, >, & in HTML without them being interpreted as HTML tags
- Special Characters: Display copyright (©), trademark (™), and other special symbols that may not render correctly
- Unicode Characters: Represent Unicode characters using numeric entities (e.g., € for €)
Numeric HTML Entities
HTML entities can be represented in two ways: named entities (like &) and numeric entities (like & or &).
- Decimal entities: Use &# followed by a decimal number (e.g., © for ©)
- Hexadecimal entities: Use &#x followed by a hexadecimal number (e.g., © for ©)