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& < > " ', 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éand€gives€. 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 <p class="note">Price: €5 & up</p>
Also € <p class="note">Price: €5 & up</p>
The apostrophe becomes ' rather than ': 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
é, … or →, and numeric references, decimal
(é) or hexadecimal (é), 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
&. Text escaped twice, such as &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: 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.