HTML Entity Encoder & Decoder
Encode and decode HTML entities instantly. Supports named, numeric, and hex entities. 100% client-side.
Drop a file here or click to upload
HTML entities are special codes used to represent characters that have special meaning in HTML or that cannot be easily typed on a keyboard. The most common HTML entities encode characters like < (less than), > (greater than), & (ampersand), and " (double quote), which have special meaning in HTML markup.
There are three formats for HTML entities: named entities (like < for <), numeric entities (like < for <), and hexadecimal entities (like < for <). Named entities are the most readable but only cover a subset of characters. Numeric and hex entities can represent any Unicode character.
HTML encoding is essential for preventing Cross-Site Scripting (XSS) attacks by ensuring user input is displayed as text rather than executed as HTML. It's also used in email templates, CMS content, and any context where special characters need to be preserved in HTML documents.
This tool runs entirely in your browser — no data is sent to any server. It supports encoding to all three entity formats and can decode any valid HTML entity back to its original character.
Frequently Asked Questions
HTML entities are special codes that represent characters in HTML. They start with & and end with ;. For example, < represents the < character.
HTML encoding prevents XSS (Cross-Site Scripting) attacks by converting special characters like < and > into harmless entity codes, preventing browsers from interpreting user input as HTML or JavaScript.
Named entities use descriptive names (like & for &), while numeric entities use character codes (like &). Named entities are more readable but only cover common characters.