Mode:

Original Text

HTML Entities

About HTML Entity Encoder / Decoder

1What is it?

Encode text into safe HTML entities or decode entities back to readable text. Convert characters like <, >, &, " and ' to numeric (&#60;) or named (&lt;) entities. Essential for safely embedding code on websites and preventing XSS vulnerabilities.

2Use Cases

  • Safely display code snippets in HTML
  • Prevent Cross-Site Scripting (XSS) in user input
  • Encode special characters for XML usage
  • Fix display issues with symbols like ©, ™, or €
  • Sanitize data for database storage

3Examples

Encode

Input

<div id='1'>

Output

&lt;div id=&apos;1&apos;&gt;

Decode

Input

&copy; 2024

Output

© 2024

?Frequently Asked Questions

What are HTML Entities?

They are codes used to display reserved characters (which would otherwise be interpreted as HTML code) or invisible characters. For example, < must be written as &lt; to show up as a less-than sign.

Named vs Numeric entities?

Named (&lt;) are easier to read. Numeric (&#60;) are more widely supported across all browsers and encodings. This tool provides both.