HTML Decoder

Try HTML Decoder

HTML Decoder inputs

Loading calculator. If this message stays visible, enable JavaScript and reload.

The HTML decoder turns character references into readable text. Paste a fragment such as Tea & toast and run the tool to recover Tea & toast. The decoder is useful when an export, example or editor shows the spelling of a reference where you expected to see its character.

Work with a text fragment and keep a copy of the original. One pass decodes one layer. For example, &amp;lt; becomes &lt; after the first pass. A second pass then gives <. The intermediate result may already be the wording you need, especially in documentation where the HTML reference itself is the subject.

Reading characters hidden behind HTML references

What can the HTML decoder recover from an encoded string?

The HTML decoder reads character references. A character reference stands for one or more Unicode characters. Named references use a recognisable name, as in &copy; for ©. Numeric references identify a character using a decimal number or a hexadecimal number. Both &#169; and &#xA9; therefore produce the same copyright sign in a browser.

These spellings can end up in copied page source, a content export or a bug report. If a field on your published page reads Research &amp; notes and the intended label is Research & notes, compare the stored input with the displayed value. The reference may have been encoded once for transport and then treated as ordinary text at the point of display. Decoding an example helps identify the intended string before you decide where an application needs a change.

The result contains actual characters. A converted line may include an angle bracket, a quote or a special space. Its appearance in an editor depends on the font and on whether the destination treats the result as plain text or as markup. Inspect the destination before replacing the stored version of a field.

How do I decode a text fragment and check the result?

  1. Copy one representative string into the text field. Include the complete reference, including its leading ampersand and ending semicolon where present.
  2. Select Calculate / Run. Compare the result with the original side by side. Focus on the boundary between the reference and its neighbouring characters.
  3. Copy the result into a plain-text editor or a text field. Verify punctuation and spacing when a value will be passed to another application.
  4. Keep the original if you are investigating a defect. Record the source context and the output you expected. Use a small fictional sample when reporting a problem that involves private data.

For a mixed export, sample records individually. One field might hold normal text, another might hold encoded references and a third might deliberately contain example HTML. Applying the same cleanup blindly can change records that were already correct. Look for the earliest stage in the export or import process where the label visibly changes.

On mobile, a reference at the end of a visual line may wrap before the semicolon. Select the full original string before copying. A broken reference pasted with an actual intervening line break can behave differently from the same text merely wrapped by the screen.

Which reference forms produce the same character?

Input spellingDecoded textHow to read the source
&amp;&A named ampersand reference.
&copy;©A named copyright reference.
&#169;©A decimal numeric reference.
&#xA9;©A hexadecimal numeric reference.
&nbsp;Non-breaking spaceA space with different line-breaking behaviour.

Keep spelling and result separate when comparing two systems. A producer can use a numeric form and another can use a named form for the same character. In a test that cares about visible text, compare the result of decoding. In a test for a specific export format, check the exact reference spelling against that format's requirements.

HTML includes a long list of named references. The official table shows the accepted spellings, their case and the characters they represent. Some old spellings without a semicolon are recognised in specific circumstances. Use a complete reference for a predictable example, especially when text follows it immediately. The WHATWG named character reference list is the reference for HTML spellings.

What happens when I decode an escaped tag example?

Enter &lt;strong&gt;Tea&lt;/strong&gt; to see the literal string <strong>Tea</strong> in the result. The word Tea stays in the same position and the four angle brackets become actual characters in the returned text. You can keep this version in a plain-text fixture or put it in a documentation code block that displays literal markup.

If your intended result is just Tea, you need a separate text extraction step and a decision about how to represent the surrounding document. A paragraph boundary may need a newline, while a formatting element around a word may need no added whitespace. The decoder here handles reference parsing via a temporary text area in the browser. It does not walk a document tree to extract heading, paragraph or link content.

There is also a difference between seeing a tag example and publishing working markup. In a code or text field, the tag characters can remain visible. In an HTML source editor, the same characters can act as markup. Preview a harmless sample in its actual destination to see which result readers will receive. The HTML encoder prepares the five common markup-sensitive characters when you need to display their literal spelling.

How can I identify two layers of encoding?

Look for a reference whose first part decodes to an ampersand, leaving the rest of a second reference behind. The example &amp;lt; has that shape. The initial decoder pass turns the &amp; part into an ampersand. The following letters and punctuation remain, so the result is &lt;. Decoding that result separately gives the less-than character.

This pattern can appear if a string meant for display is stored with references and then passed through another escaping stage. It can also be deliberate. An HTML tutorial may need to show the characters &lt; on screen as part of a lesson. Consider what the user should see before deciding whether the presence of a reference in your first output indicates an error.

For a repeatable investigation, write three columns in a scratch sheet. Record the source spelling, the result after one pass and the intended visible wording. Only create a second pass where the check shows it is required. If you repair a larger data set, keep an untouched copy and sample cases containing ordinary ampersands, punctuation and reference examples.

Why can the result look the same even when characters changed?

Some characters occupy similar space or have similar shapes. For example, a non-breaking space and an ordinary space often look alike. The non-breaking space influences where a line can wrap and remains a distinct character during searches and comparisons. A string may therefore appear identical after you paste it while one application's equality check still reports a difference.

Compare counts if a space-like result is confusing, then inspect the character itself in your editor. A sequence such as &nbsp; has several source characters but becomes one space character. The character counter helps check how long the original and decoded strings are. Length alone cannot tell two single-character spaces apart, so use an editor capable of displaying whitespace or inspecting characters when exact identity matters.

Use the find and replace tool only after you know which character needs changing. Replacing a decorative non-breaking space may be appropriate for a CSV text field, while keeping it between a number and its unit can be intentional in printed copy. Preserve the whitespace policy of the destination.

How is HTML decoding different from URL or JSON decoding?

Start by looking at the source syntax and where it came from. An HTML reference starts with an ampersand. URL percent escapes have a percent sign followed by hexadecimal digits. A JSON string can contain a backslash escape. All three types may represent the same visible character in different formats, and each is read by a different parser.

For a link copied from HTML source, one fragment might contain &amp; between query parameters while a parameter value contains %20. Decoding the HTML reference gives an ampersand used by the address. The percent escape remains part of that address until the appropriate query handling reads the value. The URL decoder is a separate operation for percent escapes when you are examining an encoded value.

If an exported field looks like a JSON document, first determine whether the ampersand reference is literally part of the string value. The JSON formatter can help inspect structure. Apply only the operation that corresponds to the data layer you are trying to read. Decoding the wrong layer can change the delimiters that the next parser expects.

How should I interpret an unfamiliar or malformed reference?

Try an unambiguous example such as &copy; to check the workflow. In a browser, recognised references follow HTML parsing rules in a text area. An unknown or incomplete reference may remain visible. A prefix that corresponds to an older HTML spelling can sometimes be recognised while extra letters remain. An unusual numeric reference can produce a replacement character. Treat those results as clues about your source, and check them against the intended text.

Consider the point at which the fragment was originally read. A value separated from its HTML attribute or surrounding document may lose context that affects parsing. A tool result is useful for testing the isolated fragment. Compare it with what the producer and destination actually do before correcting a whole document. The HTML Standard's text area definition describes the element used for the browser operation.

Keep the shortest sample that reproduces the unexpected display. Include a known reference, nearby punctuation and the exact expected result in the record. Test the ordinary case and the incomplete case separately. That makes it easier to tell whether the problem is a misspelt reference, a missing delimiter or the encoding behaviour of the sending application.

Consider an editorial export with a column for captions and another for example code. The caption column should usually contain the wording shown to readers. The example column might intentionally preserve character-reference spellings for a lesson. If the first sample is Maps &amp; charts and the second sample documents &amp; itself, decoding both changes the meaning of the second sample. Record the purpose of each column before deciding where the conversion belongs. Keep at least one normal string in your test group so you can check that correct content remains intact.

A second common case is a discrepancy between page source and a copied snippet. The browser can display an ampersand in a field while the source uses a reference. Copying from the visual page gives the displayed character. Copying from the source can give the reference. Both can correctly describe the same page. When a teammate sends you a screenshot and a code snippet that appear to differ, ask which representation they observed at each point. This can distinguish expected escaping from a display defect without changing any data.

For comparisons where exact text matters, include whitespace in the expected result. A visual review may miss a non-breaking space before a unit or an extra newline after a block. If the receiving system sorts or matches strings, test the decoded fragment under that system's rules. An editorial preview establishes whether the wording looks right. A separate string comparison tells you whether the underlying characters match a required format.

Document the intended stopping point. If a sample will appear in a code block, specify whether the reader should see the source reference or the decoded character. In a bug report, include the first conversion output even when a second pass is needed. A later maintainer can then recognise which stage added an extra layer and reproduce the repair with a short, exact example.

HTML decoder FAQs

Does the tool turn a named reference into a decimal number?

The result is the corresponding character. Both a supported named reference and a numeric reference can produce the same output. Keep the source spelling separately if you need to audit a particular file format.

Can I decode text with accents or emoji?

Ordinary accented characters and emoji can be present in the fragment. Numeric references can represent supported Unicode code points, and the browser resolves those references according to HTML's rules. Use a plain-text destination when reviewing the result.

Why did I get an ordinary ampersand in the output?

&amp; represents the ampersand character. Seeing the ampersand is the expected outcome of decoding that reference. If you need a literal reference spelling for a tutorial, keep the original or place it in a field that preserves literal text.

Will the decoder remove my paragraph tags?

Use an HTML-aware text extraction workflow to remove markup and preserve the paragraph structure you want. This utility decodes references in a text fragment. An escaped paragraph tag can become literal tag text in the output.

Do I have to decode repeatedly until nothing changes?

Stop when the output matches your intended wording. Further decoding may change deliberately documented references or characters intended to remain escaped for a later format.

What if I need to compare fragments from two editors?

Copy each fragment from the editor's source view if available and compare the exact inputs before running the decoder. After decoding, check both the displayed result and any invisible spacing required by your destination.