Developer Tools
View All Developer ToolsDate & Time
View All Date & Time ToolsText Tools
View All Text ToolsOnline Converters
View All Online ConvertersHTML Encode Decode
Encode plain text as HTML entities or decode HTML-escaped text instantly with side-by-side output.
Encode or decode HTML entities without leaving the page
Paste plain text or HTML-escaped text, switch modes, and compare the converted result side by side. The output stays read-only so you can copy the converted value without accidentally editing it.
Paste plain text here to generate HTML-escaped output.
HTML-escaped output appears here as you type.
How to use HTML Encode Decode
- Paste plain text into the input panel and keep Encode selected when you need HTML-escaped output with entities such as `<` and `&`.
- Switch to Decode when you want to turn copied HTML entities back into readable text.
- Review the converted result in the read-only output panel as the input updates instantly.
- Use Sample to load an example for the current mode, Clear to reset the workspace, or Copy Output when the result is ready.
- Use Swap when you want to move the current output back into the input and reverse the direction.
HTML encode decode examples
-
html encode decode
-
encode html entities
-
decode html entities
-
escape html for code snippet
-
convert <div> to html
What this HTML encode decode tool does
This tool converts plain text into HTML-safe entity text and also decodes HTML entities back into readable characters. It is useful when you need to escape markup before pasting it into documentation, CMS fields, templates, code examples, or text areas that should show raw HTML instead of rendering it.
When to encode vs decode HTML text
Use Encode when your source text contains markup characters such as `<`, `>`, `&`, double quotes, or apostrophes and you need a safe HTML entity version. Use Decode when you copied text that already contains entities such as `<`, `&`, `"`, or numeric entities and want to inspect the readable characters again.
HTML Encode Decode vs URL Encode Decode
HTML entity encoding and URL encoding solve different problems. HTML encoding protects markup characters inside HTML-related contexts, while URL encoding percent-escapes reserved characters for URLs and query strings. If your text is meant for markup, docs, or code samples, HTML Encode Decode is the better fit.
HTML encode decode FAQs
What does HTML encoding do?
HTML encoding replaces markup-sensitive characters such as `<`, `>`, `&`, quotes, and apostrophes with HTML entities so the text can be displayed more safely inside HTML-related contexts.
Can this tool decode copied HTML entities?
Yes. Switch to Decode mode and paste the entity text to turn it back into readable output.
Does the decoder support numeric entities?
Yes. The decoder supports common named entities as well as numeric decimal and hexadecimal entities.
What happens to unknown entities?
Unknown entity-like text is left unchanged so the tool does not invent a fake decode error for plain text or unsupported names.
When should I use HTML encoding instead of URL encoding?
Use HTML encoding when you need to escape markup characters for HTML, templates, or code snippets. Use URL encoding when the text is going into a URL or query string.