Skip to main content
HTML Entities

HTML Encoder/Decoder

Turn <, >, & and quotes into HTML entities so text displays as text, or decode &amp;, &eacute; and &#39; back into readable characters.

Your text179 characters · 5 lines
Result283 characters · 5 lines
&lt;div class=&quot;container&quot;&gt;
  &lt;h1&gt;Hello &amp;amp; Welcome&lt;/h1&gt;
  &lt;p&gt;Use &amp;lt;strong&amp;gt; for &lt;strong&gt;bold&lt;/strong&gt; text.&lt;/p&gt;
  &lt;img src=&quot;photo.jpg&quot; alt=&quot;A &amp;quot;great&amp;quot; photo&quot; /&gt;
&lt;/div&gt;
Learn more

HTML entities: what to know

When to encode HTML

To show a code sample on a web page, to put a user's text into a template without it being read as markup, or to paste content into an email or a CMS field that interprets HTML. Decoding helps when an export or an API hands you text full of &quot; and &#233;.

What is encoded

The characters that change the meaning of HTML (<, >, &, " and ') are always encoded; you can also encode every non-ASCII character as a numeric entity for systems that mangle accents. The decoder understands all named entities (&nbsp;, &copy;, &eacute;) and numeric ones, decimal or hexadecimal. Encoding is one layer of XSS protection, not a substitute for your framework's escaping.

How it works

How to encode HTML

  1. Paste your text

    Paste HTML or plain text into the input panel.

  2. Choose encode or decode

    Select Encode to convert characters to HTML entities, or Decode to convert entities back to characters.

  3. Copy the result

    Copy the output to use in your HTML, email templates, or web application.

Practical guides

Tips & guides

Prevent XSS

Cross-Site Scripting (XSS) is one of the most common web vulnerabilities. Encoding user input before inserting it into HTML prevents malicious scripts from executing.

Always encode any user-provided data that will be rendered in HTML — form inputs, URL parameters, database values, and API responses.

Security tip

Private

Your text stays in your browser. Nothing is uploaded, stored, or tracked.

Templates and internal HTML stay on your device: nothing is sent while you encode or decode.

Privacy
Frequently asked questions

Frequently asked questions

Everything you need to know about HTML encoding