HTML entity encoder and decoder
Developer tools
Paste text or entities. The direction switches automatically.
Runs in your browser
Nothing is uploaded. The work happens on your own device, so your file or text never reaches us.
About this tool
Escape the five, not everything
Only five characters actually need escaping in HTML: & < > " and the apostrophe.
On a UTF-8 page, café and 日本語 are perfectly valid as themselves. Escaping them to café makes the source unreadable and the file larger for no benefit. Every page has been UTF-8 by default since HTML5.
The "all non-ASCII" option is here for the rare case that needs it — a legacy system, an email template, a context where the encoding is not under your control.
Questions
Do I need to escape accented characters?
No, not on a UTF-8 page, which is every modern page. Escape only & < > " and the apostrophe.
What is for?
A space that will not break a line and will not collapse with neighbouring spaces. Useful between a number and its unit; overused as a layout spacer, where CSS is the right tool.
Related tools
URL encoderPercent-encode and decode URLs, with the correct choice between encoding a whole URL and encoding one parameter. Also breaks a URL into its parts.Base64Encode and decode Base64, including non-ASCII text and emoji, with URL-safe output. Explains exactly why a given string is not valid Base64.Colour converterConvert between HEX, RGB and HSL with a live preview. Accepts every common notation, including 3, 4, 6 and 8-digit hex with alpha.Contrast checkerCheck a text and background colour against the WCAG 2.1 contrast thresholds for normal text, large text and interface components.