Loona Automation logoLoona Developer Tools
Home › Encoders & Decoders

HTML Entities Encoder

In short: convert characters that are special in HTML — < > & quotes — and any non-ASCII characters into HTML entities, so browsers display them literally instead of treating them as markup. Named entities where they exist, or numeric references.
🔒 Private by design: everything runs in your browser on this device. Your input is never uploaded to a server.

Example

Input:

<p class="x">Tom & Jerry © 2026</p>

Output:

&lt;p class=&quot;x&quot;&gt;Tom &amp; Jerry &copy; 2026&lt;/p&gt;

About this converter

HTML reserves a handful of characters: & starts an entity, < and > delimit tags, and quotes delimit attributes. Writing them literally in content breaks pages or — when the text comes from users — opens the door to cross-site scripting (XSS), which is why escaping output is a baseline security habit, not a cosmetic one. Beyond safety, entities give you characters your keyboard or encoding cannot: © for ©, € for €, and numeric references like € for anything else, including characters with no name. This encoder prefers the readable named entity when one exists in its table and falls back to decimal numeric references, which every browser understands.

Frequently Asked Questions

Named or numeric entities — which should I use?

Named entities are easier to read and audit (&copy; beats &#169;); numeric ones cover every character, including those without names. Both render identically.

Does entity-encoding make user input completely safe?

It is the essential step for displaying text in HTML, but full XSS defense also needs correct handling in attributes, URLs and JavaScript contexts. Encoding here covers the HTML text context.

Why is the apostrophe sometimes &#39; and sometimes &apos;?

&apos; is the XML/HTML5 name; older HTML4 parsers did not know it, so &#39; remains the most compatible choice for apostrophes.

Related Developer Tools

Embed this tool on your website — free

Add this tool to your own website or blog — it is completely free, needs no sign-up, and always shows the latest version. Copy the code below and paste it into your page where you want the tool to appear. Keeping the small “Powered by Loona Automation” credit line under the embed helps keep this tool free — but you are free to style or remove it; the tool works either way.