Encode and decode HTML entities for safe web output
Free online HTML entity encoder and decoder. Convert special characters to HTML entities to prevent XSS and display issues, or decode entities back to text.
HTML entities are special codes used to represent characters that have meaning in HTML (like < and >) or characters that are hard to type. For example, < represents < and & represents &.
Encoding user-provided content before inserting it into HTML prevents Cross-Site Scripting (XSS) attacks. Without encoding, an attacker could inject malicious JavaScript through <script> tags.
Both represent the same character (<). Named entities like < are more readable, while numeric entities like < (decimal) or < (hex) work for any Unicode character.
Yes. The decoder handles named entities, decimal numeric entities (<), and hexadecimal entities (<).
Yes. All encoding and decoding happens in your browser. Your data never leaves your computer.
Get all tools in your browser
Install the Chrome extension for one-click access to every tool — no tab switching needed.
Last updated: January 2025