HTML Entity Converter
Convert special characters to HTML entities or decode entities back to regular characters.
About HTML Entities
HTML entities are codes used to represent characters that have special meaning in HTML or that can't be easily typed on a keyboard. They ensure proper display of characters in web browsers.
Common HTML Entities
Character | Entity Name | Entity Number |
---|---|---|
< | < | < |
> | > | > |
& | & | & |
" | " | " |
' | ' | ' |
© | © | © |
When to Use HTML Entities
- Special characters - For characters that have special meaning in HTML like <, >, and &
- Non-ASCII characters - For characters not in the ASCII character set to ensure proper display across different systems
- Security - To prevent XSS (Cross-Site Scripting) attacks by encoding user input
- Reserved characters - For characters that would otherwise be interpreted as HTML code
Encoding vs. Decoding
Encoding
Converts special characters to their HTML entity equivalents. For example:
<script> becomes <script>
Decoding
Converts HTML entities back to their original characters. For example:
© becomes ©
Example
Original text:
"Hello" & 'World'
Encoded (HTML entities):
"Hello" & 'World' <script></script>
When decoded, it returns to the original text.