HTML Encode / Decode
Convert characters to and from HTML entities (&, <, >, ", ', …).
Output appears here
What is HTML Encoding?
HTML encoding converts special characters into their HTML entity equivalents so they are displayed as text rather than interpreted as HTML markup. For example, < becomes <, > becomes >, and & becomes &.
This tool encodes strings for safe insertion into HTML documents and decodes HTML entities back to their original characters — all in your browser.
How to HTML encode text online
- Paste your plain text (or HTML with entities) into the Input box.
- Choose Encode to escape HTML characters, or Decode to unescape them.
- The result appears instantly in the Output panel.
Frequently Asked Questions
Why is HTML encoding important?
Without HTML encoding, user-supplied content containing < or > could break page layout or enable Cross-Site Scripting (XSS) attacks. Always encode untrusted strings before inserting them into HTML.
What is the difference between HTML encoding and URL encoding?
HTML encoding converts characters to HTML entities (<, &, etc.) for safe embedding in HTML markup. URL encoding converts characters to %XX sequences for safe inclusion in URLs. They serve different purposes.
Which characters must be HTML encoded?
At minimum: < (<), > (>), & (&), double-quote ("), and single-quote ('). These characters have special meaning in HTML.
What is a named HTML entity?
Named entities are human-readable shortcuts for characters: © for the copyright symbol, for a non-breaking space, € for the euro sign.