HTML Entity Encode
Encode &, <, >, and quotes as HTML entities.
Runs in your browser Your input never leaves your device.
About this tool
Replaces the five characters that have special meaning in HTML with safe entities: & becomes &, < becomes <, > becomes >, a double quote becomes " and a single quote becomes '. This lets you show code or text on a page without the browser treating it as markup. All other characters, including accented letters and emoji, are left as they are; they do not need escaping if your page uses UTF-8. Encoding helps when placing text inside HTML content or quoted attributes, but it is not a complete security solution on its own. It runs in your browser.
How to use it
- Paste the text or HTML you want to display literally.
- Copy the encoded output.
- Paste it into your HTML source.
Example
<a href="x">Tom & 'J'</a>
<a href="x">Tom & 'J'</a>
Common problems
- Accented letters are not converted
- Only five characters are encoded. Make sure your page is served as UTF-8 so other characters display correctly.
- Text is encoded twice
- Encoding already-encoded text turns & into &amp;. Encode the raw source once.
- Using it for security
- Escaping rules differ in scripts, URLs and CSS contexts. This tool is only for HTML text and attribute values.