Developer Tools

HTML Entity Encoder Decoder Online - Escape HTML Characters

Encode HTML-sensitive characters to entities or decode entities back to readable text. Escape brackets, ampersands, quotes, and snippets locally.

View all Developer Tools

Common HTML Entities Reference

&
&
<
<
&amp;gt;
>
&amp;quot;
"
&amp;#39;
'
&amp;nbsp;
space
&amp;copy;
©
&amp;reg;
®

Continue Workflow

Related tools to try next

All tools
Browser Local No sign-up

Example

Encode an HTML snippet

Encoding lets the snippet appear as text instead of being interpreted as real markup.

Input


                        <div class="hello">Hello & World</div>
                      

Output


                        &lt;div class=&quot;hello&quot;&gt;Hello &amp; World&lt;/div&gt;
                      

Decode entity text from a CMS field

Decoding is useful when reviewing stored content, but do not render untrusted decoded HTML without sanitizing it.

Input


                        Tom &amp; Jerry &lt;span&gt;example&lt;/span&gt;
                      

Output


                        Tom & Jerry <span>example</span>
                      

Practical Notes

How to Use

  1. 1. Paste text or an HTML snippet into the input field.
  2. 2. Click Encode to convert special characters into entities.
  3. 3. Click Decode to turn common entities back into readable characters.
  4. 4. Copy the output or swap it back into the input for another pass.

Features

Use Cases

Frequently Asked Questions

What is an HTML entity?
An HTML entity is a text representation of a character, such as &amp;lt; for < or &amp;amp; for &.
Is HTML encoding the same as sanitizing?
No. Encoding changes characters so they display as text. Sanitizing removes or restricts unsafe markup according to security rules.
When should I encode quotes?
Encode quotes when text will be placed inside HTML attributes or examples where quote characters could break the markup.
Is my HTML snippet uploaded?
No. Encoding and decoding run locally in your browser after the page loads. Your HTML snippets are not uploaded for processing.
When should I use HTML entities?
Use HTML entities when you want characters such as <, >, &, or quotes to display as text instead of being interpreted as markup.
Can decoded entities become real HTML?
Yes. Decoded text can contain actual angle brackets and markup. If the source is untrusted, sanitize it before rendering it as HTML.