HTML Encode & Decode Online
Convert HTML special characters to entities and back. Escape < > & for safe display in web pages.
How It Works
- 1Select Encode HTML to convert special characters to entities, or Decode HTML to convert entities back to readable text.
- 2Paste your text or HTML into the input box and click the button to process.
- 3Copy the output to use in your HTML document, template, or code editor.
About This Tool
HTML encoding converts characters that have special meaning in HTML — such as < > & " ’ — into their safe entity equivalents (< > & " '). This is essential when rendering user-supplied content inside a web page, writing code examples in documentation, or preventing cross-site scripting (XSS) vulnerabilities in web applications.
HTML decoding is the reverse process: it converts entity sequences back to their original characters, which is useful when processing HTML-formatted API responses, parsing scraped content, or reviewing what a page will display versus what its source contains. This tool handles the five core HTML entities that every developer needs, running entirely in your browser with no data sent to any server.
Understanding the difference between HTML encoding, URL encoding, and Base64 encoding is important. HTML encoding is specifically for rendering text safely inside HTML documents. It should not be confused with URL encoding (percent-encoding), which is used in query strings and path segments, or with Base64, which is used for binary-to-text data transfer.
You may also find our URL Encode / Decode, Strip HTML Tags, and Markdown to HTML helpful.
How to Use
- 1. Paste HTML or plain text into the input area.
- 2. Choose Encode to turn characters like < > & into entities, or Decode to reverse it.
- 3. Copy the result for safe use in your markup.
Frequently Asked Questions
What is HTML encoding?
HTML encoding converts special characters like < > & " into HTML entities (< > & ") so they display as text instead of being interpreted as HTML markup.
When do I need to HTML-encode text?
When displaying user input in a web page, outputting code examples, or preventing XSS attacks — any time you need text to appear literally rather than be parsed as HTML.
What characters are encoded?
The most important ones: & → &, < → <, > → >, " → ", and ' → '. These are the characters that have special meaning in HTML.
Is HTML encoding the same as URL encoding?
No. HTML encoding converts characters for safe display in HTML documents. URL encoding (percent-encoding) converts characters for safe use in URLs.
Is this tool free and private?
Yes — completely free, runs entirely in your browser, and your text is never sent to any server.
Was this tool helpful?
More Tools
Related Text & Encoders
URL Encode/Decode
Text to Handwriting
Word Counter
Base64 Encode/Decode
You Might Also Like