Loading the interface. JavaScript is required; controls stay disabled until ready.
Paste the text or HTML entities you want to convert.
Select Convert, then copy your encoded or decoded text.
Encoding replaces ampersands, angle brackets and quotes with HTML entities. Decoding converts entities ending in a semicolon once; unknown entities stay unchanged. Results remain plain text and are never executed. Maximum 1,000,000 input units.
How to use
Choose encode or decode. Paste text and Convert. Copy the result; decoded HTML stays plain text.
Examples & use cases
<strong>Hi & welcome</strong> becomes escaped markup for display, not active page elements.
About this tool
Escapes ampersand, angle brackets and quotes. Decodes semicolon-terminated references once, with Unicode numeric validation and browser named-reference handling. Unknown references follow browser text rules or remain unchanged. Maximum one million input units and 256 distinct extended named references per conversion. Decoded markup is never rendered or executed.
Questions & answers
Can decoding execute a script?
The tool assigns output only to a readonly textarea value. Named references are parsed as individual validated tokens in an isolated textarea document; raw markup never enters the parser or the live page. Decoded tags and event attributes remain text.
Display markup as text
HTML entities represent characters that would otherwise have structural meaning in markup. Encoding text for display and decoding a reference are opposite transformations, but neither operation decides whether a whole HTML document is safe.
A practical example
Encoding <b>Hi & welcome</b> escapes its angle brackets and ampersand so the markup can be displayed rather than treated as elements. A decoded reference such as & becomes its character after one pass. Already escaped data can need a different treatment, so keep track of how many transformations the input has received.
Decode once and inspect the context
This tool handles supported semicolon-terminated named and numeric references. Unknown references may remain unchanged under browser text rules, and invalid numeric code points are rejected or handled by the documented conversion behavior. Repeated decoding can change intended literal text. Check a representative example instead of decoding repeatedly until something looks familiar.
Escaping is context-specific
Text for an HTML body, an attribute, a URL and a JavaScript string have different requirements. A general entity conversion is not a sanitizer for arbitrary active content. Decoded markup remains inert on this page. Use your template engine and destination-specific escaping when inserting data into an application.
Worked example: showing code in a blog post
You want readers to see the line <a href="/">Home</a> on the page instead of a working link. Encoding it gives <a href="/">Home</a>. Paste that into your HTML or CMS code view and the browser displays the original tag as text. The less-than and greater-than signs are the essential ones; quotes matter mainly inside attribute values.
More questions about the HTML Entity Encoder / Decoder
What is the difference between named and numeric entities?
A named entity uses a readable word, such as & for an ampersand or © for the copyright sign. A numeric entity uses the Unicode code point, such as © or © for the same symbol. Both display identically. Numeric entities exist for every character, while named ones cover only a defined list.
Do I still need entities if my page uses UTF-8?
For most symbols, no. A UTF-8 page can contain é, € or emoji directly. You still need to encode characters that HTML treats as markup: < and & everywhere, and quotes inside attribute values. Entities are also useful for invisible characters such as a non-breaking space, written as .
Does encoding HTML entities prevent XSS attacks?
Encoding untrusted text before putting it into HTML is a core part of preventing cross-site scripting, but context matters. Text inside a script block, a URL or a CSS value needs different escaping. Frameworks such as Laravel Blade, React and Django escape output by default; use this tool for manual content, not as a replacement for that.
Choose your next task
- URL encoder and decoder: Encode a URL component rather than HTML text.
- Text compare tool: Compare encoded and decoded text as plain characters.