HTML Encoder / Decoder
Encode and decode HTML entities online. Convert special characters like <, >, &, quotes to HTML entities and back. Free tool.
Input (Raw HTML)
Output (Encoded HTML)
Frequently Asked Questions
What is HTML encoding?▾
HTML encoding converts special characters into HTML entities so they display correctly in a browser without being interpreted as HTML markup. For example, < becomes <, > becomes >, and & becomes &.
Why do I need to encode HTML?▾
HTML encoding is essential for security (preventing XSS attacks), displaying code snippets on web pages, and storing HTML content in databases. Without encoding, characters like < and > would break your HTML structure.
What characters need to be HTML encoded?▾
The five characters that must always be encoded are: & (&), < (<), > (>), " ("), and ' ('). In certain contexts, additional characters like / and = should also be encoded.
What is the difference between HTML encoding and URL encoding?▾
HTML encoding converts characters to HTML entities (e.g. &) for use inside HTML documents. URL encoding converts characters to percent-encoded sequences (e.g. %26) for use in URLs. They solve different problems and are not interchangeable.