Text Input

HTML Entities OutputLive

Start typing to see live preview...

HTML Encoder & Decoder Tool

Encode text to HTML entities or decode HTML entities instantly with our free online tool

What is HTML Encoder/Decoder?

HTML Encoder/Decoder is a free online tool that converts special characters to HTML entities and vice versa. This is useful for safely displaying HTML content, preventing XSS attacks, and working with special characters in web applications.

HTML encoding also protects your pages from malicious script injection (XSS) and ensures text displays correctly across browsers, email clients, and international character sets. It’s critical for rendering user comments, dynamic content, or template emails without risk of breaking markup or leaking data.

This tool supports emojis, accented characters, mathematical symbols, and all Unicode—making it ideal for React, Vue, static HTML, and any web or email application.

How to Use HTML Encoder/Decoder

To Encode Text:

  1. Select the "Encode" tab
  2. Toggle "Live Preview" to see encoding as you type
  3. Enter your text in the input field
  4. Click "Encode" to convert to HTML entities
  5. Copy the encoded text from the output

To Decode HTML Entities:

  1. Select the "Decode" tab
  2. Toggle "Live Preview" to see decoding as you type
  3. Paste your HTML entities in the input field
  4. Click "Decode" to convert back to text
  5. Copy the decoded text from the output

Example Input/Output

Encoding Example

Input Text:
<script>alert("Hello")</script>
HTML Entities Output:
&lt;script&gt;alert(&quot;Hello&quot;)&lt;/script&gt;

Decoding Example

HTML Entities Input:
&lt;script&gt;alert(&quot;Hello&quot;)&lt;/script&gt;
Decoded Text:
<script>alert("Hello")</script>