HTML Entity Encoder / Decoder
Convert special characters to HTML entities and back. Supports named entities, decimal codes, and hexadecimal codes. All processing happens locally – your data never leaves your browser.
How to Use the HTML Entity Encoder/Decoder
- Select Encode to convert special characters (
<,>,&, etc.) into HTML entities, or Decode to convert entities back to characters. - When encoding, choose your desired entity format: Named (e.g.,
<), Decimal (e.g.,<), or Hexadecimal (e.g.,<). - Optionally enable "Encode ALL characters" to convert every character (including letters) into entities, or "Preserve line breaks" to wrap the output in
<pre>tags for better readability. - Paste your text into the input area and click "Encode / Decode" – the result appears instantly.
- Copy the result to your clipboard or download it as a .txt file.
What Are HTML Entities?
HTML entities are special codes that represent characters that have a specific meaning in HTML. For example, the less‑than sign (<) is interpreted as the start of an HTML tag. To display it as text, you use the entity <.
Common HTML entities include:
<→<(less than)>→>(greater than)&→&(ampersand)"→"(double quotation mark)'→'(apostrophe) → (non‑breaking space)
Entities can also be represented using decimal codes (<) or hexadecimal codes (<).
Why Use an HTML Entity Converter?
- Prevent XSS attacks: Encoding special characters is a crucial security practice when displaying user‑generated content.
- Display code snippets: Convert HTML tags into entities so they appear as plain text on your website without being rendered.
- Email development: Some email clients strip HTML tags; encoding ensures your content displays correctly.
- Debugging: Easily inspect encoded HTML from APIs or databases.
💡 Pro tip: This tool is completely client‑side. Your text never leaves your browser – 100% private and secure.
Frequently Asked Questions
What HTML entities are supported?
The tool supports all named HTML5 entities (over 2,000), plus decimal and hexadecimal entity codes. It's based on the browser's built‑in textarea decoding, so it handles everything a modern browser does.
Is my data safe?
Absolutely. All processing happens locally in your browser. Your text is never uploaded to any server.
What's the difference between named, decimal, and hex entities?
Named entities are human‑readable (e.g.,
<). Decimal entities use Unicode code points (e.g., <). Hex entities use hexadecimal notation (e.g., <). All three are valid HTML and are interpreted the same way by browsers.Does it support Chinese or other Unicode characters?
Yes! When encoding, non‑ASCII characters are converted to numeric entities. When decoding, all valid entities are converted back to their original characters, regardless of language.