
HTML treats characters such as < and & as part of its own syntax. To show them as plain text on a page, you write them as entities: < for <, & for &. The tool below encodes text into entities and decodes entities back into text. It runs in your browser, so nothing you paste is sent anywhere.
HTML encoder and decoder
Turn special characters into HTML entities, or read entities back as text. Quotes are encoded too, so the result is safe inside an attribute.
What you enter never leaves your browser. Nothing is sent or stored.
How to use the tool
- Paste your text or markup into the text area.
- Press Encode to turn special characters into entities, or Decode to turn entities back into characters.
- Switch on the non-ASCII option only if you need it. With it on, characters above U+007E, such as
éor€, are written as numeric entities (é,€). With it off, accented letters, Turkish letters and emoji stay as they are.
Encode escapes the five characters that change meaning in HTML: &, <, >, " and '. Decode asks the browser's own HTML parser to resolve named references (©), decimal ones (©) and hexadecimal ones (©). It removes one level of encoding per press.
Entities you will meet often
&is&,<is<,>is>."is a double quote. A single quote is written', because'exists only in HTML5. is a non-breaking space, one that does not wrap to the next line.©is©and€is€.
Things to watch
- Double encoding. If a page shows
&or your text contains&lt;, it was encoded twice. Press Decode once per extra level. - Encoding is not sanitizing. Escaping makes text safe to display as text. It does not remove tags or scripts, and decoding untrusted HTML does not make it safe to insert into a page.
- Context matters. These escapes suit HTML text and quoted attribute values. JavaScript inside a script block, URLs and CSS each need their own escaping.
- Encode once, at the point of output. Keep the original text in your data and encode it when you build the HTML. Most template engines and UI frameworks do this for you by default, so encode by hand only where you assemble markup yourself.
When it comes up
The usual cases are code samples in documentation, text pasted into an email template or a CMS field, and debugging a page that shows & where it should show &.
If escaping and untrusted input keep causing bugs in a product of yours, that is part of what we do in application security and in web application development.
Frequently asked questions
Does my text leave my browser?
No. Encoding and decoding happen in the page on your device. Decoding reads the result as text only: it does not run scripts or load anything the text refers to.
Do I need entities for accented letters or emoji?
Not in a page served as UTF-8. Leave the non-ASCII option off and these characters stay unchanged. Turn it on for old encodings, some email templates, or systems that mishandle non-ASCII text.
Which characters does Encode change?
Five: &, <, >, " and '. With the non-ASCII option on, it also writes every character above U+007E as a decimal numeric entity, so 😀 becomes 😀.
Why does my text contain &amp;?
Because & was encoded a second time, which turns its & into & again. Rendered as HTML it shows the literal text &. Decode removes one level per press, so two presses restore the original.
Is "HTML decrypt" the same as decoding entities?
People who search for it usually mean decoding entities. Nothing is encrypted: entities are a reversible way to write characters and need no key. The tool does not sanitize or secure HTML.
Related services
Where this topic becomes an engagement.
Keep reading
The articles that follow this one.



