Skip to content
Free tool · runs in your browser

HTML entity encoder & decoder

Want to show HTML code on a page instead of running it? Encode it. Got text full of < and '? Decode it.

What HTML entities are for

Five characters have special meaning in HTML: < and > start and end tags, & starts an entity, and the two quote marks delimit attribute values. To show them as text you replace them with entities — &lt;, &gt;, &amp;, &quot; and &#39;. That is how tutorials display code samples, and how you stop user-entered text from being interpreted as markup.

Do you still need entities for é, £ or emoji?

Not if your page declares <meta charset="UTF-8"> and the file is saved as UTF-8 — which every modern editor does by default. Numeric entities like &#233; are only needed when the HTML will pass through a system that mangles non-ASCII text, such as some older email tools. If accented letters show as é on your published page, the charset tag is missing; the HTML checker flags it.

Decoding safely

Decoding here uses the browser's own parser inside a detached <textarea>, so it understands every named entity (&nbsp;, &mdash;, &hellip;…) without running any markup in the input.

Related guides

Frequently asked questions

What is the difference between &#39; and &apos;?

Both are an apostrophe. &apos; is valid in HTML5 and XML but was not in HTML 4, so &#39; is the most compatible choice.

Do I need to encode the > character?

Strictly only < and & are required in text, but encoding > too is conventional and harmless.

More free tools

Your HTML deserves a real link

Paste code, drop a file, a ZIP or a whole folder — get a live URL with your own address, an optional password and a QR code. Free to start with Google sign-in; paid plans keep links online for good.

Turn HTML into a link