World’s largest virtual agentic engineering & quality conference

WHENAUG 19-21
WHEREVirtual · Global
Register Now

Free HTML Entities to Text Converter Online

The HTML character encoder online converts certain characters to special strings, called HTML entities, that can be read by a browser. This tool is built and maintained by TestMu AI (formerly LambdaTest).

Categories

...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free
...
TestMu Conf 2026

World's largest virtual agentic engineering & quality conference

...

AUG 19-21, 2026

REGISTER NOW

Input

Output

What is HTML Entities to Text Converter?

The HTML entities to text encoder converts certain characters to their corresponding HTML entities. These characters have special significance in HTML and can be converted to their related HTML entities.

How does HTML Entities to Text Converter work?

The tool converts HTML entities back into their plain-text characters so the content becomes readable. Many characters, such as the ampersand and the angle brackets, are part of HTML syntax and are stored as entities. For example, the entity &amp; is decoded to &, &lt; becomes <, and &gt; becomes >, giving you clean, human-readable text.

What does the tool do?

It provides the ability to save and share the text while converting the HTML Entities decode text to plain text. Any HTML Entities file can be imported and converted into text with the help of this free tool. To preserve the meaning of certain characters in HTML, they have to be converted into their correct HTML Entities and vice versa. You can convert the characters in HTML Entities to text easily.

Why is HTML entities to text converter tool needed?

Use this free tool to convert your HTML Entities text into plain text so that it’s readable since some elements of the text have characters that are a part of the HTML syntax.

How to Decode HTML Entities Programmatically (JavaScript, Python & PHP)

Beyond this online converter, you can decode HTML entities directly in your own code. Every major language ships a tested function or library that turns entities such as &amp;, &lt;, and &#169; back into their original characters. Each snippet below takes the encoded string Tom &amp; Jerry &lt;3 and returns the readable text Tom & Jerry <3.

Decode HTML Entities in JavaScript

In the browser, the built-in DOMParser API decodes entities with no external dependencies:

function decodeEntities(str) {
  const doc = new DOMParser().parseFromString(str, "text/html");
  return doc.documentElement.textContent;
}

decodeEntities("Tom &amp; Jerry &lt;3");
// Output: Tom & Jerry <3

In Node.js (or the browser via a bundler), the popular he library decodes named, decimal, and hexadecimal entities reliably:

import { decode } from "he";

decode("Tom &amp; Jerry &lt;3");
// Output: Tom & Jerry <3

Decode HTML Entities in Python

Python 3 includes html.unescape in its standard library, so no external package is needed:

import html

html.unescape("Tom &amp; Jerry &lt;3")
# Output: 'Tom & Jerry <3'

Decode HTML Entities in PHP

PHP provides html_entity_decode, which converts every entity back to its character. Pass ENT_QUOTES so both single and double quotes are handled:

<?php
echo html_entity_decode("Tom &amp; Jerry &lt;3", ENT_QUOTES, "UTF-8");
// Output: Tom & Jerry <3
?>

Types of HTML Entities: Named vs. Numeric vs. Hexadecimal

Every HTML entity starts with an ampersand (&) and ends with a semicolon (;). The same character can be written in three different ways:

  • Named character references: human-friendly names such as &amp;, &copy;, and &lt;. They are easy to read but only exist for a fixed set of characters.
  • Decimal numeric references: the character's Unicode code point written in base 10, like &#38; or &#169;. This form works for any character.
  • Hexadecimal numeric references: the same code point written in base 16 (hexadecimal), like &#x26; or &#xA9;. This form is common in machine-generated markup.

HTML Entity Reference Table

CharacterNamedDecimalHexadecimal
&&amp;&#38;&#x26;
<&lt;&#60;&#x3C;
>&gt;&#62;&#x3E;
"&quot;&#34;&#x22;
'&apos;&#39;&#x27;
©&copy;&#169;&#xA9;

Browsers require entities for &amp;, &lt;, and &gt; because those characters are reserved by HTML syntax. The rest are optional but keep markup portable across different character encodings.

HTML Entity Decoding vs. URL Decoding (What is %27?)

HTML entity decoding and URL decoding are often confused because both turn encoded text back into readable characters, but they belong to two different systems.

  • HTML entity decoding converts references used inside HTML markup, for example &#39; or &apos; back into a single quote (').
  • URL decoding converts percent-encoding used inside web addresses, for example %27 back into a single quote (').

So what is %27? %27 is the percent-encoded (URL-encoded) form of the single quote character. The 27 is that character's code point in hexadecimal (39 in decimal). It is not an HTML entity; its HTML equivalents are &#39; and &apos;. If you see %27 in a string, decode it with a URL decoder; if you see &#39;, decode it with this HTML entities to text converter.

Frequently Asked Questions (FAQs)

How to decode an HTML encoded string?

Paste the encoded string into the input box above and click Convert to Text. The tool replaces named HTML entities with their original characters. In code, use html.unescape() in Python, html_entity_decode() in PHP, or the he library or DOMParser in JavaScript.

What is the difference between HTML entity decoding and URL decoding?

HTML entity decoding converts references like &amp; or &#169; that appear inside HTML markup. URL decoding converts percent-encoded sequences like %26 or %27 that appear inside web addresses. They are separate encoding schemes, so a single quote is &#39; in HTML but %27 in a URL.

Which HTML entities can this tool convert?

It decodes the standard named HTML entities, including &amp;, &lt;, &gt;, &quot;, &copy;, and the full Latin-1 set of accented letters, symbols, and punctuation. Paste your entity-encoded text and click Convert to Text to see the readable result.

How do I convert text back into HTML entities?

To go the other way and encode characters into entities, use the Free Text to HTML Entities Converter, which turns characters like &, <, and > into their entity form.

Did you find this page helpful?

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests