Encode and decode HTML entities for safe display
Input
Output
Common HTML Entities
&
&
Ampersand
<
<
Less than
>
>
Greater than
"
"
Double quote
'
'
Single quote
␣
Non-breaking space
©
©
Copyright
®
®
Registered
™
™
Trademark
€
€
Euro
£
£
Pound
¥
¥
Yen
—
—
Em dash
…
…
Ellipsis
←
←
Left arrow
→
→
Right arrow
•
•
Bullet
°
°
Degree
Examples
Before Encoding:
<script>alert("Hello & World")</script>After Encoding:
<script>alert("Hello & World")</script>