HTML Encoder / Decoder

Convert between plain text and HTML entities to safely display content on the web.

About HTML Entities

Encoding replaces special characters like <, >, & with entities so browsers display them as text.

ℹ️

About this HTML Encoder/Decoder

Encode or decode HTML entities (e.g. < to <, « to «). Prevents XSS and displays special characters safely in HTML. Essential for web forms and user-generated content. All processing in your browser.

Key Features

Encode <, >, &, quotes to entities

Decode HTML entities to characters

Handle common and named entities

Copy result

Works in your browser

📖

How to Use

1

Enter text to encode or entity string to decode

2

Click Encode or Decode

3

Copy the result into your HTML or code

💡

Popular Use Cases

1

Escape user input for safe HTML output

2

Display code or special chars in HTML

3

Decode entities from APIs or docs

4

Prevent XSS when rendering user content

💡

Tips & Best Practices

Always encode user input before inserting into HTML to prevent XSS.

Common entities: < &lt; > &gt; & &amp; " &quot; ' &#39;

Frequently Asked Questions

Q

What are HTML entities?

Special sequences like &lt; that represent characters (e.g. <). Used to display <, >, &, and quotes safely in HTML.

Q

When should I encode?

When inserting untrusted or user text into HTML. Encoding prevents the browser from interpreting it as tags or script (XSS).

Q

Decode vs encode?

Encode: turn < into &lt; for safe display. Decode: turn &lt; back into < when you have entity text and need plain characters.