# HTML Entity Encoder/Decoder

Encode and decode HTML entities

> Canonical page: https://test.elysiatools.com/en/tools/html-entity-encoder

- **Category:** Development

- **Keywords:** html, entity, encoder, decoder

## Overview

Encodes text into numeric HTML character references for &, <, >, quotes, and every non-ASCII character, or decodes named and numeric entities back to text. ASCII letters, digits, spaces, and ordinary punctuation are left unchanged when encoding.

## Inputs

- **Text Input** (textarea): Enter text to encode/decode...
- **Operation** (select)

## When to use

- Displaying code snippets or user text containing characters like <, >, or & inside HTML without breaking markup.
- Extracting clean, human-readable text from web-scraped strings or API responses that contain entity codes.
- Troubleshooting double-escaped or improperly formatted text fields across web templates.

## How it works

- Paste or type your content into the Text Input field.
- Choose Encode to convert special characters to HTML entities, or Decode to convert entities to plain characters under Operation.
- Review the output text to verify that targeted symbols or entity references transformed correctly.

## Use cases

- Code tutorial formatting: Convert raw HTML tags into entities so code samples render visibly on a web page instead of executing as DOM elements.
- Scraped data cleanup: Decode extracted database fields containing entity codes like &amp; or &#39; into standard readable characters.
- Email template preparation: Encode dynamic text values containing ampersands and quotation marks before injecting them into HTML email bodies.

## Frequently asked questions

### Which characters does the Encode operation modify?

It converts &, <, >, quotes, and every non-ASCII character into numeric HTML character references such as &#x26; and &#x3C;. Named references such as &amp; are not produced.

### Does Decode handle both named and numeric entities?

Yes, it parses standard named references (such as &amp;) as well as decimal (&#38;) and hexadecimal (&#x26;) numeric character entities.

### Does decoding text strip away HTML tags?

No. Decoding only translates entity representations into their respective characters (e.g., <div> becomes

); it does not strip or sanitize the resulting tags.

### Can this tool encode URL query parameters?

No. URL parameters require percent-encoding (like %20); HTML entity encoding is intended for markup documents.

## Related tools

- [XML Escape / Unescape](https://test.elysiatools.com/en/tools/xml-escape): Escape and unescape XML special characters (& < > " ') with optional numeric references, slash escaping, and CDATA wrapping
- [URL Encoder/Decoder](https://test.elysiatools.com/en/tools/url-encoder): URL encode and decode strings
- [Base64 Encoder/Decoder](https://test.elysiatools.com/en/tools/base64-encoder): Encode and decode Base64 strings
- [Base64URL Encoder/Decoder](https://test.elysiatools.com/en/tools/base64url-encoder): Encode and decode Base64URL (URL-safe Base64 variant used by JWT/JWS/JWE), with conversions between standard and URL-safe Base64
- [Caesar Cipher](https://test.elysiatools.com/en/tools/caesar-cipher): Encode, decode, and brute-force the Caesar cipher with any shift (1–25), or print all 25 candidate decodings.
- [ASCII85 Converter](https://test.elysiatools.com/en/tools/ascii85-converter): Encode and decode text to/from ASCII85 format (Adobe version)
- [Atbash Cipher](https://test.elysiatools.com/en/tools/atbash-cipher): Encode and decode text using Atbash substitution cipher (reverses the alphabet)
- [Base32 Converter](https://test.elysiatools.com/en/tools/base32-converter): Encode and decode text to/from Base32 format with multiple variants

## Samples

- [HTML Viewer Samples](https://test.elysiatools.com/en/samples/html-viewer-samples): Sample HTML files (semantic page, form, landing page) for the in-browser HTML Viewer
- [HTML with Images Samples](https://test.elysiatools.com/en/samples/html-with-images): HTML source code samples with images for testing extraction
- [Hex/Unicode Encoding Format Samples](https://test.elysiatools.com/en/samples/text-hex-unicode-formats): Examples of hex (\xXX) and unicode (\uXXXX) escape sequence encoding formats
- [Distributed Tracing Samples](https://test.elysiatools.com/en/samples/distributed-tracing-samples): Comprehensive distributed tracing examples using Jaeger, OpenTelemetry, and other modern observability tools for microservices architecture

## Related content

- [Base, Radix, and Hex Encoding Tools](https://test.elysiatools.com/en/hubs/base-radix-and-hex-encoding-tools): Convert text and bytes across Base variants, arbitrary radices, hex, and web escapes while checking reversible byte preservation.
- [HTML Content Extraction, Cleanup, and Delivery](https://test.elysiatools.com/en/hubs/html-content-extraction-cleanup-and-delivery): Extract links, images, attributes, and tables from HTML, remove unwanted markup, and ship verified Markdown, PDF, or CSV outputs.
