HTML Entity Decoder
Decode HTML entities back to their original characters.
What is HTML Entity Decoding?
HTML entity decoding converts HTML entities (like <, >, &) back to their original characters. This is useful when you need to convert encoded HTML back to readable text or actual HTML code.
When Do You Need HTML Entity Decoding?
- Reading Encoded Data: Convert HTML entities from databases or APIs back to readable text.
- Data Processing: Process and clean data that contains HTML entities.
- Content Migration: Convert content from systems that encode HTML entities.
- Debugging: View the actual characters behind HTML entities.
- Email Content: Decode HTML entities from email content or templates.
Common HTML Entity Decoding Examples
- < becomes <
- > becomes >
- & becomes &
- " becomes "
- ' becomes '
- becomes non-breaking space
How to Use This HTML Entity Decoder
- Paste your HTML entity encoded text in the input field above.
- Click the "Decode HTML" button.
- The decoded result will appear in the output field.
- Use the "Copy Result" button to copy the decoded text.
Named vs Numeric HTML Entities
HTML entities come in two forms: named entities (like < for <) and numeric entities (like < for <). This tool decodes both types. Named entities are more readable, while numeric entities can represent any Unicode character.
HTML Decoding vs Unescaping
HTML decoding and HTML unescaping are the same process: converting HTML entities back to their original characters. Use our HTML Entity Encoder if you need to encode instead of decode. Use our HTML Entity Encoder if you need to encode instead of decode.
HTML Entity Decoding in Programming Languages
HTML entity decoding is available in all major programming languages. Here are examples:
PHP
$decoded = html_entity_decode($encoded, ENT_QUOTES, 'UTF-8');
JavaScript (Browser)
// Browser: Set innerHTML (be careful with untrusted data!)
// element.innerHTML = encoded;
// Or use DOMParser
const parser = new DOMParser();
const doc = parser.parseFromString(encoded, 'text/html');
const decoded = doc.documentElement.textContent;
JavaScript (Node.js)
// Node.js with library
const he = require('he');
const decoded = he.decode(encoded);
Python
import html
decoded = html.unescape(encoded)
Go
import "html"
decoded := html.UnescapeString(encoded)
Java
import org.apache.commons.text.StringEscapeUtils;
String decoded = StringEscapeUtils.unescapeHtml4(encoded);
Ruby
require 'cgi'
decoded = CGI.unescapeHTML(encoded)
C#
using System.Web;
string decoded = HttpUtility.HtmlDecode(encoded);