HTML Entity Encoder / Decoder
Encode special characters to HTML entities or decode HTML entities back to characters. Supports named, numeric, and Unicode entities.
Common HTML Entities Reference
What are HTML Entities?
HTML entities are special codes used to represent reserved characters (<, >, &) and symbols that cannot be easily typed. They start with & and end with a semicolon. Named entities like & are human-readable, while numeric entities like & use character codes.
When to Use HTML Entities
- - Displaying HTML tags as text in web pages
- - Preventing XSS (cross-site scripting) attacks
- - Inserting special characters and symbols
- - Ensuring proper rendering across all browsers
How to Encode and Decode HTML Entities Online
- 1. Select Encode to convert special characters to HTML entities, or Decode to convert entities back to characters.
- 2. Paste or type your input in the text area. Results update in real time as you type.
- 3. Use Swap Input/Output to quickly flip the result back as input for chained encoding/decoding.
- 4. Click Copy to copy the result to your clipboard.
- 5. Refer to the reference table above for common HTML entities and their character codes.
Frequently Asked Questions
What is the difference between named and numeric HTML entities?
Named entities use a human-readable name like & for the ampersand character. Numeric entities use the Unicode code point in decimal (&) or hexadecimal (&) format. Both produce the same result, but named entities are easier to read in source code.
Why do I need to encode HTML entities?
Characters like <, >, &, and " have special meaning in HTML. If you include them directly in your HTML content, browsers may interpret them as markup instead of displaying them as text. Encoding prevents rendering issues and XSS security vulnerabilities.
Does this tool support Unicode characters?
Yes. When encoding, any character with a code point above 127 (non-ASCII) is converted to a hexadecimal Unicode entity like € for the Euro sign. When decoding, both hex (&#x...;) and decimal (&#...;) numeric entities are supported.
Is my data sent to a server?
No. All encoding and decoding runs entirely in your browser using JavaScript. Your text is never uploaded or stored anywhere.