XConvert
Downloads
Pricing

Decode HTML Entities Online

Turn HTML entity-encoded content into readable text by decoding common entities like & and < in seconds.

Read Only

HTML Entity Decoder โ€” Convert HTML Entities Back to Plain Text

Decode HTML entities back to their original characters instantly with the XConvert HTML Entity Decoder. Paste text containing named entities (&, <), decimal references (©), or hexadecimal references (©) and get clean, readable plain text. This free, client-side tool runs entirely in your browser โ€” no data is sent to any server.

HTML entities are essential for safe web content, but they make source code and raw data difficult to read. When you are inspecting HTML source, processing scraped web content, debugging template output, or migrating content between systems, you need to convert those entity references back to the characters they represent. The XConvert HTML Entity Decoder handles all entity types โ€” named, decimal, and hexadecimal โ€” and produces clean Unicode text instantly.

How to Decode HTML Entities with XConvert (4 Steps)

  1. Open the HTML Entity Decoder โ€” Navigate to the XConvert HTML Entity Decoder in any modern browser. No sign-up or installation is required.
  2. Paste the Encoded Text โ€” Enter or paste text containing HTML entities into the input field. The text can contain any mix of named entities (like &), decimal numeric references (like &), hexadecimal references (like &), and plain text.
  3. View the Decoded Output โ€” The tool instantly converts all HTML entities to their corresponding Unicode characters. The output is clean, readable plain text with no entity references remaining.
  4. Copy the Decoded Text โ€” Copy the decoded output to your clipboard for use in documents, code, databases, or any other context where you need the original characters.

The decoder handles all 2,231 named HTML entities defined in the HTML5 specification, as well as any valid decimal or hexadecimal numeric character reference.

What Are HTML Entities?

HTML entities are encoded representations of characters that have special meaning in HTML or that cannot be easily typed on a keyboard. They serve two primary purposes: preventing special characters from being interpreted as HTML markup, and representing characters that are not available in the document's character encoding.

Every HTML entity starts with an ampersand (&) and ends with a semicolon (;). There are three forms:

  • Named entities use a descriptive name: &amp; decodes to &, &lt; decodes to <, &gt; decodes to >, &quot; decodes to ", &copy; decodes to ยฉ, &mdash; decodes to โ€”, and &nbsp; decodes to a non-breaking space.
  • Decimal numeric references use the character's Unicode code point: &#38; decodes to &, &#169; decodes to ยฉ, &#8212; decodes to โ€”.
  • Hexadecimal numeric references use the code point in hex: &#x26; decodes to &, &#xA9; decodes to ยฉ, &#x2014; decodes to โ€”.

When a browser renders an HTML page, it automatically decodes all entities and displays the corresponding characters. The XConvert decoder performs this same conversion on raw text, which is useful when you are working with HTML source code outside of a browser context.

For the reverse operation โ€” encoding plain text into HTML entities โ€” use the HTML Entity Encoder.

Comparison Table

Feature XConvert Decoder Browser DevTools Programming Libraries
Client-side processing โœ… Yes โœ… Yes โš ๏ธ Depends
No data transmission โœ… Yes โœ… Yes โœ… Local
Named entity support โœ… All 2,231 โœ… All โœ… Varies by library
Numeric references โœ… Decimal + hex โœ… Yes โœ… Yes
Full Unicode support โœ… Yes โœ… Yes โœ… Yes
Handles mixed content โœ… Entities + plain text โš ๏ธ Manual โœ… Yes
Double-decode detection โœ… Visual comparison โŒ No โŒ Manual
No installation โœ… Yes โœ… Built into browser โŒ Requires setup
Batch processing โœ… Yes โŒ Manual โœ… With scripting
Cost Free Free Free

Common Use Cases

  1. Reading HTML Source Code โ€” When inspecting the source of a web page, entity-encoded content like &lt;div class=&quot;container&quot;&gt; is hard to read. Decoding it to <div class="container"> makes the content immediately understandable.

  2. Processing Web Scraped Data โ€” Web scraping tools often capture raw HTML including entity references. Before using the scraped text in your application, database, or analysis pipeline, decode the entities to get clean plain text. This is especially common when scraping product descriptions, article content, or user reviews.

  3. Debugging Template Output โ€” When a template engine or CMS double-encodes content (turning & into &amp;amp;), the page displays literal entity text instead of the intended characters. The decoder helps you identify and fix these double-encoding issues by showing what each layer of decoding produces.

  4. Migrating Content Between Systems โ€” When moving content from one CMS, database, or platform to another, entity-encoded text may need to be decoded and re-encoded according to the target system's conventions. The decoder provides the clean intermediate text.

  5. Cleaning Data Exports โ€” Database exports, CSV files, and API responses sometimes contain HTML entities from web-originated data. Decoding these entities produces clean text suitable for reports, spreadsheets, and non-HTML contexts. Pair with the CSV to JSON Converter or JSON to CSV Converter for data transformation workflows.

  6. Accessibility and Screen Reader Testing โ€” Screen readers interpret decoded text, not entity references. Decoding entities helps you verify that the actual character content is correct and will be read properly by assistive technologies.

Technical Details of HTML Entity Decoding

HTML entity decoding is the process of replacing entity references with their corresponding Unicode characters. The HTML5 specification defines the complete set of named character references in a JSON mapping that associates each entity name with one or more Unicode code points. The XConvert decoder implements this full mapping, ensuring that even obscure named entities like &heartsuit; (โ™ก), &bigstar; (โ˜…), and &NotSquareSubsetEqual; (โŠ„) are decoded correctly.

Numeric character references are decoded by parsing the decimal or hexadecimal number after &# or &#x, then converting the resulting code point to the corresponding Unicode character. The decoder validates that the code point falls within the valid Unicode range (U+0000 to U+10FFFF, excluding surrogates U+D800 to U+DFFF) and that it does not reference a prohibited control character. Invalid references are left unchanged in the output, making it easy to identify malformed entities.

A common challenge in entity decoding is handling double-encoded or multiply-encoded content. When text passes through multiple encoding stages โ€” for example, user input encoded by a web framework, then encoded again by a template engine โ€” entities get nested: & becomes &amp;, which becomes &amp;amp;. The XConvert decoder performs a single pass of decoding by default, which is the correct behavior for most use cases. If you suspect multiple layers of encoding, you can decode the output again until no further entities remain. Comparing the input and output after each pass helps you determine how many encoding layers were applied.

Tips for Best Results

  1. Decode one layer at a time โ€” If you suspect double or triple encoding, decode once and inspect the output. If entities remain, decode again. This methodical approach helps you understand how many encoding layers were applied and where the problem originates.
  2. Preserve the original โ€” Always keep a copy of the original encoded text before decoding. If the decoded output is used in an HTML context, you may need to re-encode it with the HTML Entity Encoder to prevent XSS vulnerabilities.
  3. Watch for &nbsp; (non-breaking spaces) โ€” Non-breaking spaces (&nbsp;, Unicode U+00A0) look identical to regular spaces but behave differently in text processing. After decoding, be aware that what appears to be a normal space might be a non-breaking space, which can cause issues in string comparisons and text processing.
  4. Check for incomplete entities โ€” An ampersand followed by text but missing the closing semicolon (e.g., &amp without ;) may or may not be decoded depending on the context. The XConvert decoder follows the HTML5 parsing rules, which are lenient about missing semicolons for some named entities.
  5. Use UTF-8 for the decoded output โ€” After decoding, ensure the decoded text is saved or transmitted using UTF-8 encoding. This preserves all Unicode characters, including emoji, CJK characters, and mathematical symbols that were represented as entities.
  6. Validate decoded content before re-embedding in HTML โ€” If you plan to insert the decoded text back into an HTML document, always re-encode it first using the HTML Entity Encoder. Inserting raw decoded text into HTML can reintroduce the security and parsing issues that encoding was designed to prevent.

Frequently Asked Questions

What types of HTML entities can the decoder handle?

The XConvert HTML Entity Decoder handles all three types: named entities (e.g., &amp;, &copy;, &mdash;), decimal numeric references (e.g., &#38;, &#169;), and hexadecimal numeric references (e.g., &#x26;, &#xA9;). It supports all 2,231 named entities defined in the HTML5 specification.

What is double encoding and how do I fix it?

Double encoding occurs when already-encoded text is encoded again. For example, & becomes &amp;, and if encoded again, becomes &amp;amp;. The page then displays the literal text &amp; instead of &. To fix it, decode the text multiple times until no entities remain, then encode it exactly once before inserting it into HTML.

Does the decoder handle &nbsp; (non-breaking space)?

Yes. &nbsp; is decoded to Unicode character U+00A0 (non-breaking space). This character looks like a regular space but prevents line breaks at that position and is not collapsed by HTML rendering. Be aware that it may cause unexpected behavior in string comparisons.

Can I decode entities from an entire HTML page?

Yes, you can paste an entire HTML page into the decoder. However, be aware that decoding will convert all entities, including those in the HTML tags themselves. This means &lt;div&gt; will become <div>, which changes the meaning of the content. For most use cases, you should decode only the text content, not the full HTML markup.

What happens with invalid or unknown entities?

Invalid entities (malformed references or unknown named entities) are left unchanged in the output. This makes it easy to identify problematic entity references in your content. For example, &notarealentity; will appear as-is in the decoded output.

Is the decoder safe to use with sensitive data?

Yes. The XConvert HTML Entity Decoder runs entirely in your browser using client-side JavaScript. Your text is never transmitted to any server, making it safe for confidential, proprietary, or personally identifiable information.

What is the difference between &apos; and &#39;?

Both represent the apostrophe/single quote character ('). &apos; is the named entity (defined in XML and HTML5), while &#39; is the decimal numeric reference. They produce identical output when decoded. Note that &apos; was not defined in HTML4, so &#39; is sometimes preferred for maximum compatibility.

Can I use the decoder to clean web-scraped text?

Yes. Web scraping often captures raw HTML with entity references. Pasting the scraped text into the decoder converts all entities to plain characters, producing clean text suitable for analysis, storage, or display in non-HTML contexts.

How does the decoder handle emoji encoded as entities?

Emoji and other characters outside the Basic Multilingual Plane are decoded from their numeric references. For example, &#128512; or &#x1F600; both decode to the ๐Ÿ˜€ emoji. The decoder correctly handles these multi-byte characters.

Can I encode text back to HTML entities?

Yes. Use the HTML Entity Encoder for the reverse operation. Together, the encoder and decoder provide complete round-trip conversion between plain text and HTML entity-encoded text.


Related XConvert Tools: HTML Entity Encoder ยท URL Encoder/Decoder ยท Base64 Encoder/Decoder ยท CSV to JSON Converter ยท JSON to CSV Converter

Image Tools

Image CompressorCompress JPEGCompress PNGCompress GIFCompress WebPImage ConverterImage Resizer

Video Tools

Video CompressorCompress MP4MP4 to GIFVideo to GIFVideo ConverterVideo Cutter

Audio Tools

Audio CompressorCompress MP3Compress WAVAudio ConverterFLAC to MP3Audio Cutter

Document Tools

Compress PDFMerge Images to PDFSplit PDFPDF to JPGUnzip FilesRAR Extractor
ยฉ 2026 XConvert.com. All Rights Reserved.
About UsPrivacy PolicyTerms of ServiceContactHelp Us Grow