Toolantern
Home › HTML Entity Encoder / Decoder
Free tool. No sign-up.

HTML Entity Encoder / Decoder

Encode text into HTML entities (< > &) or decode entities back to text. Choose named entities for common characters or numeric entities for everything.

What the tool does

HTML entities let you display reserved characters safely: < becomes &lt;, & becomes &amp;. Encoding also prevents cross-site scripting when you insert user text into a page. Decoding reverses the process, turning &copy; back into ©.

Named vs numeric

By default common characters use readable named entities (&lt; &gt; &amp; &quot;) and anything else uses numeric codes (&#169;). Check the box to force numeric entities for every character.

Worked example

Encoding 5 > 3 & 2 < 4 gives 5 &gt; 3 &amp; 2 &lt; 4, which renders in a browser exactly as the original text.

Planning estimate only. Results use the list prices shown and may differ from your actual bill. Terms

Frequently asked questions

What is an HTML entity?

A code like < or © that represents a character in HTML. Entities let you show characters that would otherwise be interpreted as markup, like angle brackets and ampersands.

When should I encode text?

Whenever you insert untrusted or user-supplied text into HTML. Encoding < > & and quotes neutralizes injected scripts, which is the basic defense against XSS.

Named or numeric entities?

Both render identically. Named entities (<) are readable; numeric entities (<) cover every Unicode character including emoji. This tool uses named for common characters and numeric for the rest by default.

Is my text sent to a server?

No. Encoding and decoding happen locally in your browser.

More free tools