HTML Encoder
Escape HTML special characters so text renders safely inside a web page, with an option to encode non-ASCII too.
How it works
- 1
Paste or type the text you want to embed in an HTML page — special characters are escaped as you type.
- 2
Turn on 'Encode non-ASCII' if you need accented letters and emoji expressed as numeric entities for older parsers.
- 3
Copy the result and paste it safely into your HTML source. Nothing leaves your browser.
Questions
Which characters are always encoded?
The five characters that have special meaning in HTML: & (ampersand), < (less-than), > (greater-than), " (double quote), and ' (single quote).
What does the non-ASCII option do?
It converts any character outside the ASCII range — accented letters, emoji, CJK characters, and so on — to a decimal numeric entity like é. The result is safe in any HTML document, even one declared as ASCII.
Is my text sent anywhere?
No. Everything runs in your browser with no network requests. Your text stays on your device.
Does this prevent XSS?
Encoding these five characters stops user-supplied strings from being interpreted as HTML markup or JavaScript when placed in HTML text content or quoted attributes. Always use a purpose-built library for a full security review.
More text tools
Word Counter
Count words, characters, sentences, and paragraphs as you type, with reading and speaking time.
Character Counter
Count every character in your text — total and without spaces — as you type.
Sentence Counter
Count sentences and see average words per sentence update as you type.
Paragraph Counter
Count paragraphs and get average sentences, words, and characters per paragraph.
Reading Time Estimator
Estimate how long it takes to read your text at an adjustable reading speed.
Speaking Time Estimator
Calculate how long it takes to deliver your text aloud at a chosen speaking pace.
Uppercase Converter
Convert any text to uppercase instantly, with full support for accented and international characters.
Lowercase Converter
Convert any text to lowercase instantly, handling accented and international characters correctly.