HTML Entity Decoder

Decode HTML entities (`<`, `>`, `&`, `"`, `'`, `<`) back to raw unescaped HTML markup code and plain text.

How to Use the HTML Entity Decoder

1

Paste Encoded String

Enter any HTML entity-encoded text (e.g. &lt;div&gt;, &#60;h1&#62;, &#x3c;span&#x3e;) into the input box.

2

Decode Payload

Click Decode HTML Entities to restore original unescaped HTML characters.

3

Copy Result

Copy clean, unescaped HTML markup directly into your editor or web application files.

Tool Options

Universal Entity Unescaping

Decodes named W3C entities (&amp;, &lt;, &gt;, &quot;), decimal codes, and hex unicode points.

Web Development Debugging

Inspects double-escaped entities and restores human-readable source code from serialized database records.

Deterministic REST API

Provides a lightweight REST API endpoint (`POST /api/html/html-decoder`) for automated log parsing and web scrapers.

Your Data Privacy

Web Tool
Privacy-First Architecture
Most of our web tools process your data entirely in-browser. Where server processing is technically required, payloads are evaluated statelessly in-memory and are never stored, saved, or logged.
REST API
Stateless In-Memory Processing
When you use our API endpoints, your requests are processed strictly in-memory without persistent database storage, disk logging, or data retention.
Want to learn more about how we safeguard your information and infrastructure?
Read our full Privacy Policy for detailed security standards, data retention principles, and compliance guarantees.

What does the HTML Entity Decoder do?

The HTML Entity Decoder converts encoded entity strings (&lt;, &gt;, &amp;, &quot;, &#39;, &#x3c;) back into raw, unescaped HTML markup code and readable plain text characters. It decodes all W3C standard named entities, decimal codes (&#60;), and hexadecimal unicode entities (&#x3c;).

Core Concepts

Understanding HTML entity unescaping mechanics:

  • Named Entity Mapping: Replaces standard HTML entities like &lt; (<), &gt; (>), &amp; (&), &quot; ("), and &apos; (') with their native characters.
  • Decimal Code Processing: Resolves ASCII decimal entities (&#34;, &#60;, &#62;) via character code point lookups.
  • Hexadecimal Entity Resolution: Translates hexadecimal unicode escapes (e.g. &#x3c;, &#x26;) into raw UTF-8 glyphs.

How to use the tool?

  1. Enter Encoded HTML: Paste your entity-encoded string into the input editor or click Load Sample.
  2. Execute Decode: Click Decode HTML Entities to convert entities into unescaped plain characters.
  3. Inspect & Copy: Review the decoded output and entity count, then click Copy or Download.

Related Developer Utilities

If you work with HTML entities, markup sanitization, and text formatting, explore these complementary tools:

REST API Integration

Blueutils provides a free REST API endpoint (POST https://blueutils.com/api/html/html-decoder) to programmatically decode HTML entities back to raw unescaped HTML markup code.

API Request Parameters

Name Type Description Example
rawText String HTML entity-encoded string payload to decode. "&lt;div class=&quot;card&quot;&gt;Hello &amp; World&lt;/div&gt;"

API Request Payload Examples

cURL

curl -X POST https://blueutils.com/api/html/html-decoder \
  -H "Content-Type: application/json" \
  -d '{
    "rawText": "&lt;div class=&quot;card&quot;&gt;Hello &amp; World&lt;/div&gt;"
  }'

Python

import requests

url = "https://blueutils.com/api/html/html-decoder"
payload = {"rawText": "&lt;div class=&quot;card&quot;&gt;Hello &amp; World&lt;/div&gt;"}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())

Java

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        String jsonPayload = """
            {
                "rawText": "&lt;div class=\\"card\\"&gt;Hello &amp; World&lt;/div&gt;"
            }
            """;

        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://blueutils.com/api/html/html-decoder"))
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
            .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}

API Response Parameters

Name Type Description Example
isValid Boolean Indicates whether decoding succeeded. true
entityCount Number Total count of entities decoded. 4
decodedText String Unescaped plain-text HTML string. "<div class=\"card\">Hello & World</div>"
output String Decoded HTML output string. "<div class=\"card\">Hello & World</div>"

API Response Payload Examples

Success Response (HTTP 200 OK)

{
  "isValid": true,
  "entityCount": 4,
  "decodedText": "<div class=\"card\">Hello & World</div>",
  "output": "<div class=\"card\">Hello & World</div>"
}

Validation Failure Response (HTTP 400 Bad Request)

{
  "isValid": false,
  "error": "Invalid input: HTML entity payload to decode cannot be empty."
}

Rate Limit Exceeded Response (HTTP 429 Too Many Requests)

{
  "error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}

Why use an API to decode HTML entities?

Integrating the HTML Entity Decoder API into web crawlers, log ingestion tools, or AI agent tool calling provides key benefits:

  • Rapid Script Validation: Unescapes serialized HTML payloads from database records and API error responses automatically.
  • Optimized Token Efficiency for AI Agents: LLMs frequently struggle with double-escaped HTML entities. Invoking the API normalizes text deterministically without consuming token budget.
  • Deterministic Accuracy Without Hallucinations: Ensures 100% accurate named, decimal, and hexadecimal entity resolution.

Native Usage

How to decode HTML entities locally in terminal environments or scripts:

Windows (CMD / PowerShell)

# Decode HTML entities in PowerShell
[System.Net.WebUtility]::HtmlDecode('&lt;div&gt;Hello &amp; World&lt;/div&gt;')

Linux / Unix (Bash)

# Decode HTML entities using Python in Linux
python3 -c "import html; print(html.unescape('&lt;div&gt;Hello &amp; World&lt;/div&gt;'))"

Python

Using Python html.unescape:

import html

encoded_text = '&lt;div class="card"&gt;Hello &amp; World&lt;/div&gt;'
decoded_text = html.unescape(encoded_text)
print("Decoded:", decoded_text)

Java

Using Java String.replace:

public class HtmlDecoderExample {
    public static void main(String[] args) {
        String encoded = "&lt;div&gt;Hello &amp; World&lt;/div&gt;";
        String decoded = encoded.replace("&amp;", "&")
                                .replace("&lt;", "<")
                                .replace("&gt;", ">")
                                .replace("&quot;", "\"");
        System.out.println(decoded);
    }
}

Frequently Asked Questions (FAQ)

How do I decode HTML entities back to raw HTML code online?

Paste your entity-encoded string into the input box and click Decode HTML Entities. The tool converts named entities (&lt;), decimal codes (&#60;), and hex codes (&#x3c;) back to raw HTML.

Which HTML entity format types are supported for decoding?

The decoder handles all W3C standard named entities (&amp;, &quot;, &lt;, &gt;), decimal numeric entities, and hexadecimal unicode entities.

Is my encoded HTML text sent to external servers?

No. All entity unescaping and string decoding run 100% client-side directly inside your browser. Your input text stays completely private.

Rate Limits

UI Limits
100 uses per 15 minutes
Max payload size: 5 MB
API Limits
5 requests per 60 minutes
Max payload size: 256 KB
Need higher API rate limits, increased payload sizes, or custom developer solutions?
Contact our engineering team at support@blueutils.com for custom rate limit increases, higher quota allocations, or tailored enterprise integrations.