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.
From the Textify Team
We built this encoder/decoder because we needed a fast, private way to convert code snippets for tutorials and documentation. No more pasting sensitive HTML into unknown websites. Everything happens right here in your browser, so you can encode client data, API responses, or example code without worrying about privacy. We hope it saves you time and keeps your data safe.
Frequently Asked Questions
<). 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.