HTML Entity Encode / Decode
Encode special characters to HTML entities and decode HTML entities back to text. Handles & < > " '. Free, client-side tool.
Why Use the HTML Entity Encoder/Decoder?
When displaying text that contains HTML special characters like <, >, &, or quotes, you must encode them as entities to prevent XSS attacks and rendering issues. Our tool makes encoding and decoding HTML entities simple and reliable with a helpful reference table.
Key Features
- Encode < > & " ' to their HTML entity equivalents
- Decode HTML entities back to their original characters
- Built-in entity reference table for quick lookup
- Swap button to easily switch between encoding and decoding
How to Use
- Select the Encode or Decode tab
- Paste your HTML or entity-encoded text in the input area
- Click the action button and copy the result
Technical Details
Encoding uses regex replacement for the five core HTML entities: & (&), < (<), > (>), " ("), and ' ('). The ampersand is encoded first to prevent double-encoding. Decoding reverses these replacements. Numeric entities (&#NNN;) are not currently supported.
FAQ
Why should I encode HTML entities?
Encoding prevents browsers from interpreting special characters as HTML markup. This is essential for user-generated content to prevent XSS attacks and display issues.
Does this handle numeric entities like <?
Currently, the tool handles the five named entities (&, <, >, ", '). Numeric entities are not decoded in this version.
Related tools
Base64 Encode / Decode
Encode text to Base64 or decode Base64 strings with full Unicode support
URL Encode / Decode
Encode and decode URLs with full or component encoding modes
JWT Token Decoder
Decode JWT tokens to view header, payload, and signature as formatted JSON
ROT13 Cipher
Encode or decode text using the ROT13 substitution cipher
Morse Code Translator
Convert text to Morse code and back with visual representation and audio playback
Binary Translator
Convert text to binary (0s and 1s) and back with byte-level breakdown