HTML Encoder (Escape Special Characters)
Convert &, <, >, quotes and optionally all non-ASCII characters into safe HTML entities.
How to use HTML Encoder
Step by step
Paste your text
Paste the text or code.
Choose options
Optionally encode non-ASCII characters.
Copy the result
Use the Copy button.
Features and benefits
What you get
Live result
The output updates as you type or change an option.
Private
Your code is processed in your browser by this page and is not sent anywhere.
Clear errors
Problems are reported with a short message instead of silent failure.
No sign-up
Open the page and start.
Supported formats and limitations
What to expect
Supported formats
Plain text
Size limits
Limited by browser memory
Limitations
Runs fully in your browser. Very large inputs (several MB) can slow the page.
Frequently asked questions
Quick answers
Which characters are encoded?
The five that matter in HTML: & < > " and the apostrophe, plus every non-ASCII character if you choose.
Is this enough to prevent XSS?
It is the basic step for text content. Context matters, so follow your framework’s security guidance.
Related tools
More from Developer Tools
JSON Formatter
Format, indent, sort and minify JSON. Invalid JSON is reported with the line and column of the problem.
JSON Validator
Check whether your JSON is valid. If it is not, see the exact line and column and a plain-English reason.
HTML Formatter
Indent and tidy HTML. Inline tags stay on the line, and embedded CSS and JavaScript are formatted too.
Related guides
Read more about this tool