Encode or decode HTML entities in named, decimal, or hex format. Swap encode ↔ decode with one click — runs entirely in your browser.
Output will appear here
HTML entities represent reserved characters safely in markup. For example, < becomes <, & becomes &, and a quote can become ". Numeric entities use Unicode code points in decimal or hexadecimal form.
| Mode | Example for ampersand | Best for |
|---|---|---|
| Named | & | Human-readable HTML |
| Decimal | & | Generic Unicode handling |
| Hexadecimal | & | Code-oriented workflows |
<!-- encoded user text remains text, not markup -->
<script>alert("Hello")</script>
Encoding output before inserting untrusted values into HTML helps prevent markup injection. It is not a replacement for contextual escaping, sanitization, or a content-security policy.
Decode only text whose source you trust. The result may contain tags or scripts; treat decoded output as data until a safe renderer escapes it again.
This tool is provided for general informational and utility purposes only. Results may be inaccurate, incomplete, outdated, or contain errors. Always verify results before relying on or using them.
Some tools may use AI, automated processing, third-party services, or server-side processing. Do not rely on these tools as a substitute for professional advice.
Use at your own risk. BestToolOnline makes no guarantees regarding the accuracy, reliability, completeness, availability, or suitability of results, to the maximum extent permitted by applicable law.
See our Terms of Service and Privacy Policy for complete details.