What is HTML Encoder / Decoder?
Free HTML encoder and decoder. Convert special characters to HTML entities and back. Encode &, <, >, quotes, and all non-ASCII characters. No signup.
HTML Encoder runs entirely in your browser using JavaScript (browser). Your data never leaves your device.
Free HTML Encoder / Decoder
Encode text to safe HTML entities so special characters render correctly in browsers and don't break your markup. Decode HTML entities back to their original characters. Supports full HTML5 entity encoding including &, <, >, ", ', and all non-ASCII Unicode characters. Useful for sanitizing user input, working with HTML templates, and debugging escaped content.
Common HTML entities
Frequently Asked Questions
You might also like
Browse all 19 Developer Tools tools →Base64 Encoder / Decoder
Encode and decode Base64 text and files instantly
URL Encoder / Decoder
Encode and decode URLs — encodeURIComponent, encodeURI, and Base64 modes
JSON Formatter
Format, validate, and minify JSON instantly
HTML Entities Explained
HTML entities are escape sequences that represent characters with special meaning in HTML. The five most critical are & (&), < (<), > (>), " ("), and ' ('). Browsers interpret < and > as HTML tag delimiters and & as the start of an entity reference — so any text containing these characters must be encoded before being inserted into HTML, otherwise the browser may misinterpret the content or render broken markup.
HTML Encoding and XSS Prevention
Cross-site scripting (XSS) attacks work by injecting malicious HTML or JavaScript into a page. The primary defense is escaping user-supplied content before rendering it. If a user submits <script>alert(1)</script> as their username and you display it without encoding, the browser will execute the script. After encoding, it becomes <script>alert(1)</script> — rendered as literal text, not executed. All major server-side frameworks include built-in HTML escaping. Use this tool to verify or manually encode strings when working outside a framework.
Named vs. Numeric Entities
HTML supports three entity formats: named (© → ©), decimal numeric (© → ©), and hexadecimal numeric (© → ©). Named entities only exist for a defined set of characters. Numeric entities work for any Unicode code point. When embedding HTML inside XML, JSON, or other formats that have their own special characters, numeric entities are the safer choice as they avoid any parser conflicts with the outer format.