HTML Entity Encoder/Decoder
Securely escape special characters for HTML, XML, and JavaScript. Bidirectional conversion for XSS prevention and code formatting with support for decimal and hex entities.
About
Web security relies heavily on the correct handling of user input and data display. When raw text containing reserved characters is rendered by a browser, it can break the layout or, more critically, execute malicious scripts-a vulnerability known as Cross-Site Scripting (XSS). This tool converts reserved characters into their corresponding HTML entities, rendering them safe for display. Conversely, it decodes entities back to their original state for editing or readability. This utility handles standard reserved characters alongside extended ASCII and Unicode symbols, supporting both decimal and hexadecimal formats used in modern web development standards.
Formulas
The encoding process maps a specific character to a predefined sequence. For example, the less-than symbol is crucial for defining HTML tags. To display it literally, it must be escaped.
Reference Data
| Character | Entity Name | Decimal | Hexadecimal | Description |
|---|---|---|---|---|
| " | " | " | " | Quotation Mark |
| & | & | & | & | Ampersand |
| < | < | < | < | Less Than |
| > | > | > | > | Greater Than |
| ' | ' | ' | ' | Apostrophe |
| © | © | © | © | Copyright Sign |
| ® | ® | ® | ® | Registered Sign |
| € | € | € | € | Euro Sign |
| |   |   | Non-breaking Space | |
| ™ | ™ | ™ | ™ | Trademark |
| ← | ← | ← | ← | Left Arrow |
| ∞ | ∞ | ∞ | ∞ | Infinity |