HTML Entity Encode / Decode

HTML Entity Encode / Decode

Local Processing

Convert characters such as <, & and " to HTML entities or back.

How It Works & Processing Standards

Convert characters such as <, & and " to HTML entities or back.

Tool processing runs in your browser. If you create a calculator or conversion share link, its values are included in the URL. See the privacy policy for account, analytics and advertising data.

Current Limits

  • Maximum input length: 100,000 characters

Choose encode or decode under "Task" — for showing code samples on a web page or reading entities in page source.

What You Can Do

Encode
Turns <, >, &, " and ' into entities, optionally all non-ASCII characters too.
Decode
Turns named and numeric entities like &lt; or &#44032; back into characters.

How to Use HTML Entity Encode / Decode

  1. 1
    Choose a taskEncode or decode.
  2. 2
    Enter textWhen encoding, choose whether to include non-ASCII characters.
  3. 3
    CopyPaste into HTML source or text.

Examples

Show tags as text
Input: <b>Tom & Jerry</b>
Result: &lt;b&gt;Tom &amp; Jerry&lt;/b&gt;
Decode entities
Input: &lt;p&gt;5 &gt; 3 &amp;&amp; 2 &lt; 4&lt;/p&gt;
Result: <p>5 > 3 && 2 < 4</p>

Common Use Cases

  • Showing HTML code samples on a blog
  • Reading entities in RSS or XML data
  • Checking special characters before inserting user input into HTML

Frequently Asked Questions (FAQ)

Does this prevent XSS?

It helps for text content, but attributes, URLs and scripts each need different handling. Use your framework’s escaping in real services.

Should non-ASCII text be encoded?

Not for UTF-8 documents. Turn on "encode all non-ASCII" only for older systems.

Have feedback or ideas for this tool? Suggest & Inquire →