HTML Entity Encoder/Decoder
Encode special characters to HTML entities or decode entities back to readable text.
This tool is for informational and educational purposes only. It is not a substitute for professional financial, medical, legal, or engineering advice. See Terms of Service.
Can't find what you need?
Request a ToolHow to Use the HTML Entity Encoder/Decoder
This tool converts special characters to their HTML entity equivalents, or decodes HTML entities back to readable text. All processing happens in your browser. Here is how to use it:
- Paste your text or HTML. Enter the content you want to encode or decode in the input box. You can paste raw HTML, plain text with special characters, or text containing HTML entities.
- Choose your mode. Select "Encode" to convert special characters like <, >, &, and quotes into their HTML entity forms. Select "Decode" to convert HTML entities back to their original characters.
- Optional: Encode all non-ASCII. Check this box to also convert accented characters, emoji, and other non-ASCII characters to numeric HTML entities. This is useful when you need pure ASCII output for legacy systems or email templates.
- View the result. The output updates live as you type. The result card shows the character count and how many entities were encoded or decoded.
- Copy the output. Click the Copy button to copy the processed text to your clipboard.
Encoding is essential when displaying user-generated content in HTML to prevent XSS attacks and rendering issues. Decoding is useful when you need to read or edit HTML source that contains encoded entities.
About the HTML Entity Encoder/Decoder
HTML entities are special sequences that represent characters which have meaning in HTML syntax. For example, the less-than sign (<) starts an HTML tag, so displaying a literal < in a web page requires using the entity < instead. This tool handles all five standard HTML entities (&, <, >, ", ') plus named entities like , ©, and —. It also handles numeric entities in both decimal (©) and hexadecimal (©) formats. The optional non-ASCII encoding converts any character outside the basic ASCII range (codes 0-127) to a numeric entity, which is useful for email HTML and systems that do not support UTF-8.
Frequently Asked Questions
What are the most common HTML entities?
The five most common HTML entities are: & for the ampersand (&), < for less-than (<), > for greater-than (>), " for double quotes ("), and ' for single quotes ('). These are the characters that can interfere with HTML parsing.
Why should I encode HTML entities?
Encoding prevents browsers from interpreting special characters as HTML markup. This is critical for security (preventing XSS/cross-site scripting attacks) and for displaying code examples, mathematical expressions, and user input correctly on web pages.
What does "Encode all non-ASCII" do?
When enabled, this option converts every character outside the basic ASCII range (character codes 128 and above) to a numeric HTML entity. This includes accented characters, symbols, and emoji. It produces output that is safe for systems that only support ASCII encoding.
Is my data sent to a server?
No. All encoding and decoding happens in your browser using JavaScript. Your text is never transmitted to any server. This tool is safe for sensitive content and source code.