HTML Encoder
Escape special characters to HTML entities for safe display
How to Use
- Paste or type your raw HTML or text into the input box on the left.
- Toggle Encode ALL characters if you want every character output as a numeric entity (NNN;).
- The encoded output updates automatically in real time as you type.
- Click the Copy button to copy the encoded text to your clipboard.
Frequently Asked Questions
What characters does the HTML encoder convert?
By default the encoder converts the five essential HTML characters: ampersand (&), less-than (<), greater-than (>), double quote ("), and single quote ('). Enable Encode ALL characters to convert every character to its numeric entity form.
Does HTML encoding prevent XSS attacks?
Yes. Encoding user input as HTML entities stops browsers from interpreting angle brackets and quotes as active markup, which is the primary defense against stored and reflected XSS in output contexts.
Should I encode all characters or just special ones?
For most use cases, encode only the five special characters. Full numeric encoding is useful for obfuscation or when content must contain zero HTML markup, but it produces larger, less readable output.
Is my data sent to a server?
No. All encoding happens entirely in your browser with JavaScript. Your text never leaves your device.