HTML Entity Encode

Encode special characters into HTML entities like & and <.

Output

Usage examples

Safely inserting text into HTML source

Before dropping user-entered text straight into an HTML document, convert characters like &, <, and > into entities so they don't break the markup.

Showing a code sample in documentation

When you want to display an HTML/XML snippet as literal text in a blog post or doc, encode it first so the browser doesn't interpret it as real tags.

Converting emoji or non-Latin text into numeric entities

Turn on 'Also encode all non-ASCII characters' to convert emoji or characters like 日本語 into numeric references such as &#26085;.

Frequently asked questions

Is my text sent to a server?

No. All encoding happens entirely in your browser, and what you enter is never sent to a server.

Is there any risk of a script executing?

No. Your input is handled safely as a text node and only the resulting escaped markup is read back, so it's never parsed or executed as real HTML.

Which characters are encoded by default?

The five characters with special meaning in HTML — &, <, >, ", and ' — are encoded by default.

Can I decode entities too?

Yes — use the 'HTML Entity Decode' tool for the reverse conversion.