HTML Entity Encoder/Decoder
Convert special characters to HTML entities and vice versa
Input Text
Common HTML Entities Reference
Features & Use Cases
Encoding (Special Characters โ HTML Entities):
- Prevent XSS attacks in web applications
- Display special characters safely in HTML
- Ensure proper character rendering
- Make text browser-compatible
Decoding (HTML Entities โ Special Characters):
- Convert HTML entities back to readable text
- Process scraped web content
- Clean up encoded email content
- Restore original text formatting
Supported Entities:
Basic HTML entities (&, <, >, ", '), Currency symbols (โฌ, ยฃ, ยฅ, ยข), Mathematical symbols (ร, รท, ยฑ, ยฐ), Greek letters (ฮฑ, ฮฒ, ฯ, ฯ, ฯ), Arrows (โ, โ, โ, โ), Special punctuation (โฆ, โ, โ), and numeric entities ({ วด etc.)
About the HTML Entity Encoder
HTML entities let you display characters that would otherwise be interpreted as markup, such as <, >, & and quotes, or characters that are hard to type, like ยฉ and โฌ. This tool encodes plain text into HTML entities and decodes entity-encoded strings back to readable text. It is useful when embedding code samples in a web page, sanitising user input for display, or reading escaped strings from an API or database.
How to use the HTML Entity Encoder
- Paste the text or HTML you want to convert.
- Encode to turn special characters into entities, or Decode to turn entities back into characters.
- Use the reference table to look up a specific entity.
- Copy the result into your template or content.
Frequently asked questions
What is the difference between named and numeric entities?
Named entities such as & are readable; numeric entities such as & or & work for any Unicode character even if no name exists.
Does encoding protect against XSS?
Encoding output for display is one important defence, because it stops injected markup from being executed. It should be combined with proper input validation.
Which characters must always be encoded in HTML?
At minimum &, < and > in text content, and additionally quotes inside attribute values.