HTML Encode
Encode special characters to HTML entities
How to use
- Paste text or HTML you want to escape.
- Special characters are converted to HTML entities.
- Copy the safe output to embed in a page.
Why use this tool
- Prevents breakage: Escapes <, >, &, and quotes so content displays as text, not markup.
- Safer output: Useful when showing code or user content inside HTML.
- 100% private: Everything runs in your browser. Your data is never uploaded to a server, so it's safe for confidential content.
Frequently asked questions
When should I HTML-encode?
Whenever you want to display characters like < or & as literal text rather than have the browser interpret them as markup.
Does this prevent XSS?
Encoding output is a key part of preventing XSS, but full protection depends on context and proper handling throughout your app.
Is my text private?
Yes. Encoding runs in your browser.
Back to all tools