The HTML Entity Decoder on FreeToolZones converts HTML entities back into the readable characters they represent. Text that arrives full of entity codes, such as content copied from page source, exported from a database, or received through a feed, becomes plain readable text again. The decoder handles named, decimal, and hexadecimal entities, and it repeats the decoding until the text is stable, which repairs text that was encoded more than once.
Entities are useful in HTML source, but they are miserable to read. A sentence with every special character written as a code is hard to proofread, hard to quote, and hard to paste into a document. Decoding restores the words. A reader who receives entity-filled text usually wants the characters, not the codes, and this tool performs that restoration in one step.
Double encoding is a common and confusing problem. When text is encoded twice, the entity codes themselves get encoded, and a single decoding pass only peels off one layer. This decoder keeps decoding until a pass changes nothing, up to five passes, so doubly encoded text comes out clean without requiring you to run the tool repeatedly. This page explains how the decoder works and when to use it.
What Is the HTML Entity Decoder?
The HTML Entity Decoder is a browser-based tool that replaces HTML entities in text with their corresponding characters. You paste text containing entities into the input area, and the tool shows the decoded result in an output panel. The conversion updates automatically as you type, after a short delay, and the Decode button runs it immediately on demand.
Three forms of entity are decoded. Named entities use a word between an ampersand and a semicolon, such as the named entity for the copyright symbol or the named entity for an em dash. Decimal numeric entities use the character’s decimal code point. Hexadecimal numeric entities use the hexadecimal code point. All three forms decode to the same characters, and mixed text containing all three forms decodes correctly in one pass.
The repeated decoding behavior handles text that was encoded more than once. After each decoding pass, the tool checks whether the result changed. If it did, the tool decodes again, up to a maximum of five passes. When a pass produces no further change, the text is stable and the process stops. This means text encoded twice, or even three times, emerges fully decoded. Genuine text that happens to contain an entity-like sequence after decoding is decoded too, which is the correct behavior for a decoder, though it is worth knowing when the input mixes literal entity text with encoded text.
The tool starts with a sample already loaded, containing named entities for an ampersand, a less-than sign, quotation marks, a dash, a currency sign, and a copyright symbol. The sample decodes immediately, showing the transformation before you supply your own text.
After decoding, the tool shows two statistics: the number of entities found in the input and the number of characters in the decoded output. The entities-found count is based on sequences matching the entity pattern in the original input. Comparing the two numbers gives a sense of how much of the input was entity code versus ordinary text.
How to Use the HTML Entity Decoder
Decoding entity-filled text takes a few steps.
- Paste your text with entities. Click inside the text area and paste the text to decode. Replace the preloaded sample with your own text, or edit the sample in place. If the input is empty, the tool shows a message asking you to paste some text with entities first.
- Review the decoded output. The result appears in the output panel automatically. Entity codes become their characters, and ordinary text passes through unchanged. Check the statistics to see how many entities were found.
- Check for remaining entity codes. Read through the output for any entity-like sequences that remain. A remaining sequence may be malformed, such as a missing semicolon, or it may be literal text that was never an entity. Malformed sequences do not decode and need manual fixing.
- Copy the decoded text. Press Copy decoded text to copy the result to your clipboard. If there is no output yet, the tool shows a message explaining that you need to decode some text first. Press Clear to empty the input and the output.
The automatic updating means you can paste text and immediately see the result, without pressing anything. The Decode button is there for explicit control and for re-running the conversion after edits. Either way, the repeated decoding happens automatically; you never need to run the tool multiple times for doubly encoded text.
When the input is very long, give the tool a moment after pasting. The short delay before conversion keeps the page responsive, and the result appears as soon as you pause. The statistics update together with the output.
Key Features of the HTML Entity Decoder
The decoder covers the full range of entity forms and the double-encoding problem.
- Three entity forms. Named, decimal numeric, and hexadecimal numeric entities all decode in one operation.
- Repeated decoding. Up to five passes run until the text is stable, repairing text that was encoded more than once.
- Automatic conversion. The output updates as you type, with a Decode button for immediate conversion.
- Entity statistics. The count of entities found and the decoded character count describe the conversion.
- Sample text. A preloaded sample demonstrates the decoding immediately.
- One-click copying. The Copy decoded text button copies the result to the clipboard.
- Safe decoding. Decoding uses a detached text area element, so markup inside the text is never parsed as elements and nothing executes.
- Private processing. Everything runs in your browser. Your text is not uploaded.
The safe decoding method deserves a note. The tool decodes by placing the text into a detached text area, whose content is treated as raw text. Markup in the input is never parsed into elements, and no scripts run. The decoded output is shown as text in the output panel, never rendered as a page. You can decode untrusted text without worrying that it will execute.
Practical Use Cases
Entity-filled text appears in many workflows, from content migration to data export.
Cleaning content copied from page source
Text copied from HTML source often contains entities for quotation marks, dashes, and symbols. Decoding it produces clean text suitable for a document, a message, or a fresh draft. The alternative, manually replacing each entity, is slow and invites missed codes.
Repairing double-encoded content
Content that passed through two encoding steps displays entity codes as visible text on the page. A single decoding pass fixes only the outer layer. The repeated decoding in this tool strips all layers, restoring the original characters in one operation. This is the most valuable use of the tool for migration and import work.
Reading exported data
Database exports, feed items, and API responses sometimes carry entity-encoded text. Decoding the export makes it readable for review, proofreading, and manual correction. The decoded text can then be re-encoded correctly for its final destination, or used as plain text.
Preparing quotations and citations
Quoting a passage that contains entities requires clean text. Decoding first ensures the quotation contains the actual characters, including proper quotation marks and dashes, rather than their codes. This matters for accuracy in published quotations.
Debugging encoding problems
When a page displays entity codes as text, decoding a sample reveals how many layers of encoding are present and what the original text was. That information guides the fix: if two layers are present, one encoding step in the pipeline is redundant and should be removed at the source.
Recovering text from escaped snippets
Code examples and snippets stored in escaped form decode back into the original code text. The decoded output is shown as text, so it can be copied into an editor without rendering. This is useful when recovering examples from documentation source or from stored content.
Tips and Best Practices
These practices help you decode accurately and avoid reintroducing the problem.
- Decode the original, not a copy of a copy. Work from the earliest available version of the text. Each additional copy through an encoding step can add another layer.
- Check the entity count against your expectation. A count far higher than expected suggests multiple encoding layers or text that is mostly entity code. A count of zero means the input contained no well-formed entities.
- Fix the pipeline, not just the text. If content keeps arriving double-encoded, find the redundant encoding step and remove it. Decoding each batch by hand is a workaround, not a fix.
- Watch for malformed entities. Entities missing their closing semicolon, or containing characters that do not belong, may not decode. Fix the malformed sequences by hand after decoding the rest.
- Do not decode text you intend to display as code. If the goal is to show entity codes as visible text on a page, decoding defeats the purpose. Keep the codes and let the page display them through escaping.
- Proofread after decoding. Decoding restores characters, but it cannot restore meaning lost to earlier corruption. Read the result to confirm it says what it should.
- Keep a copy of the encoded original. If the decoded text needs to return to an encoded context, having the original avoids guessing which characters were entities.
When decoded output still shows entity codes, count the layers. Each visible code represents one more layer than the tool removed, though five passes cover nearly every real case. Text showing codes after decoding was usually encoded more than five times, which points to a seriously broken pipeline, or the codes are literal text that was never meant to decode.
Limitations
The decoder converts entities to characters; it does not parse HTML structure, remove tags, or validate markup. Tags in the input pass through the decoding process as text, and the output may still contain markup that needs separate handling. For tag removal, use a tag stripper or a text converter after decoding.
Repeated decoding stops after five passes or when the text stabilizes. Text encoded more than five times will still show entity codes after decoding, though this is rare outside deliberately constructed examples. The decoder cannot distinguish between an entity that represents an encoded character and literal text that merely looks like an entity; both decode. The tool does not save your text; copy the output before leaving the page.
One more practical limit concerns very large inputs. Decoding runs entirely in the browser, and extremely long documents with many entities may take a noticeable moment to process, especially when several passes are needed. For most articles, exports, and snippets the conversion feels instant. If you are working with an unusually large file, consider splitting it into sections and decoding each section separately, which also makes the output easier to proofread.
Frequently Asked Questions
What kinds of entities does the decoder handle?
Named entities, decimal numeric entities, and hexadecimal numeric entities are all decoded. Mixed text containing all three forms decodes correctly in one operation.
How does the decoder handle double-encoded text?
It decodes repeatedly until a pass changes nothing, up to five passes. Doubly encoded text, where the entity codes themselves were encoded, emerges fully decoded without manual repetition.
Why do some entity codes remain after decoding?
Remaining codes are usually malformed, missing a semicolon, or literal text that was never an entity. They may also indicate more than five layers of encoding, which is rare. Inspect the remaining codes and fix them by hand.
Is it safe to decode text from an untrusted source?
Yes. Decoding happens in a detached text area, so markup is never parsed and nothing executes. The output is shown as text, never rendered as a page.
What does the entities found count measure?
It counts sequences in the original input that match the entity pattern. It reflects the input before decoding, so doubly encoded text counts the outer layer’s entities.
Is my text uploaded anywhere?
No. The decoder runs entirely in your browser. Your text is not sent to a server.
Related Tools
- HTML Entity Encoder for converting text into entities.
- HTML Unescape Tool for reversing escaped text with the same repeated decoding.
- HTML Escape Tool for escaping text so it displays as code.
- URL Decoder for decoding percent-encoded addresses.
- Base64 Decoder for decoding Base64 data.