HTML entity encoder and decoder

Escape text before inserting it into a page, or recover the original text behind HTML entities.

Result

Send with onlyU — Your recipient gets a link they can open only once, then the link is gone. onlyU opens in a new tab with the secret already filled in: all you have to do is create the link. Free, no sign-up. How does it work?

Anyone can undo an encoding: it protects nothing. To pass on a decoded credential, “Send with onlyU” delivers it through a link that opens only once.

Computed in your browser. Nothing is sent unless you choose onlyU.

Escape text to display it in HTML

In an HTML page, some characters carry meaning: < opens a tag, & starts an entity, a quotation mark closes an attribute value. To display these characters as text, you replace them with HTML entities. Choose Encode, paste your text, then pick the mode:

  • Special characters only: the five characters & < > " ' become &amp; &lt; &gt; &quot; &#39;, and everything else stays the same. This is enough for text inserted into the body of a page or into a quoted attribute, in a UTF-8 page.
  • Also accents and symbols: every non-ASCII character also becomes a hexadecimal numeric reference, é gives &#xE9; and € gives &#x20AC;. The result is pure ASCII, which helps when the encoding of a file, an email or an intermediate system is not guaranteed.
Text         <p class="note">Price: €5 & up</p>
Minimal      &lt;p class=&quot;note&quot;&gt;Price: €5 &amp; up&lt;/p&gt;
Also €       &lt;p class=&quot;note&quot;&gt;Price: &#x20AC;5 &amp; up&lt;/p&gt;

The apostrophe becomes &#39; rather than &apos;: that named entity exists in HTML5 and XML but not in HTML 4, whereas the numeric reference is understood everywhere.

Decode HTML entities

In Decode mode, paste a text that contains entities. All named HTML entities, such as &eacute;, &hellip; or &rarr;, and numeric references, decimal (&#233;) or hexadecimal (&#xE9;), are decoded by your browser. Tags remain text: a <script> in the input appears as is in the result, and nothing runs.

This is handy for reading an RSS feed, content pulled from a CMS database, an API response that returns escaped HTML, or a password stored in an XML configuration file, where & is written &amp;. Text escaped twice, such as &amp;eacute;, decodes in two passes with the Use the result as input button, which takes the result and switches direction.

A detail behind many failed string comparisons: &nbsp; decodes to a non-breaking space (U+00A0), a different character from an ordinary space.

How far escaping goes

These five characters protect the content of a page and quoted attributes. A <script> block, an event attribute such as onclick, a javascript: address or CSS each need their own treatment. Our guide HTML entities and XSS covers these contexts, the automatic escaping of template engines and the role of a CSP.

Sharing the result

The calculation runs in your browser, and the page is not allowed to make network requests. When the decoded text is a credential, “Send with onlyU” passes the result to onlyU from one tab to another in your browser, never in an address and never through the kit's server. onlyU encrypts it in your browser and creates a link that opens only once, valid for 24 hours, then disappears.

Frequently asked questions

Which characters must be escaped in HTML?

& < > in content, plus " and ' in attribute values. These five characters are enough for text inserted into the body of a page or into a quoted attribute.

Is escaping enough against script injection?

It is enough for content and quoted attributes, not inside a <script> block, an event attribute, a javascript: URL or CSS, which each need their own treatment. A CSP adds a second line of defence.

What is the “also accents” option for?

To produce HTML entirely in ASCII (é becomes &#xE9;), useful when the encoding of the file or channel is not guaranteed. In UTF-8, it is not needed.

Does decoding handle &eacute; or &hellip;?

Yes, all named HTML entities and numeric references (&#233;, &#xE9;) are decoded by your browser, without interpreting tags.

Is the text sent anywhere?

No, everything happens in your browser. Only a click on “Send with onlyU” passes on the result, from one tab to another.