Decode and encode HTML entities online directly in your browser. This HTML entity decoder and encoder helps you unescape HTML, convert HTML entities to text, or encode special characters for safe display in HTML. It converts reserved characters such as `&`, `<`, `>`, `"`, and `'` into entity equivalents like `&`, `<`, `>`, `"`, and `'`, and decodes them back again. Extended mode can also convert accented letters, symbols, and emoji to numeric entities.
Paste normal text, escaped HTML, or an HTML-encoded string into the input, then choose whether to encode HTML or decode HTML back to readable text. It works as a simple HTML decode online tool, HTML encode online tool, and private browser-based helper for unescaping HTML entities. Everything runs locally in your browser — your text never leaves your device.
Inakodi herufi tano zilizohifadhiwa za HTML pekee: & < > " ' — herufi zenye lahaja na emoji zinapita bila mabadiliko.
🔒 Maandishi yako yanashughulikiwa kwenye kivinjari chako. Hakuna kinachopakiwa.
This is a private, browser-based HTML entity decoder and encoder. It works as a simple HTML entities converter for developers, bloggers, CMS users, and students who need to decode HTML-encoded text, unescape HTML entities, or encode HTML characters safely. The tool uses pure JavaScript string iteration and a curated named-entity map to process text entirely on your device, with no server round-trip and no third-party libraries.
An HTML entity is a short piece of text that represents a character in HTML source code. Entities are used when a character would be ambiguous or invalid in raw HTML — for example, the `<` and `>` characters delimit HTML tags, so a literal `<` in text content must be written as `<` to prevent the browser from misinterpreting it as the start of a tag.
HTML entities come in two forms. Named entities use a human-readable name preceded by `&` and followed by `;`, for example `&` for an ampersand, `©` for a copyright sign, or `—` for an em dash. Numeric entities use a decimal or hexadecimal Unicode code point instead of a name — decimal `©` and hex `©` both produce the copyright sign ©.
The five reserved HTML characters have named entities every developer should know:
Beyond the reserved set, HTML also defines named entities for hundreds of characters including accented letters (`é` = e with acute accent), non-breaking spaces (` `), typographic punctuation (`—` = em dash, `“` and `”` = curly double quotes), currency symbols (`€` = euro sign), mathematical symbols, and Greek letters.
Encode HTML entities whenever you are inserting plain text into an HTML document and that text might contain characters reserved by the HTML grammar. The most common scenarios are:
Use basic mode when you only need to escape the five reserved characters and want accented letters and emoji to remain readable. Use extended mode when you need maximum HTML compatibility or are working with a legacy system that only supports ASCII.
Decode HTML entities when you receive text that has already been escaped and you need to read, process, or display the original characters. In search terms, this is often called HTML decode, HTML unescape, htmldecode, or converting HTML encoded text to normal text. Common situations include:
This tool decodes both named entities (`&`, `©`, `—`, ` `, and hundreds more) and numeric entities in both decimal (`©`) and hexadecimal (`©`) notation.
This encoder offers two levels of encoding detail.
Basic mode encodes only the five reserved HTML characters: `&` becomes `&`, `<` becomes `<`, `>` becomes `>`, `"` becomes `"`, `'` becomes `'`. All other characters — including accented letters like `é` and `ü`, symbols like `©` and `—`, and emoji like 😀 — are passed through unchanged. Use basic mode when your target environment handles Unicode natively and you only need to prevent HTML parsing errors.
Extended mode encodes the same five reserved characters and additionally converts every non-ASCII character to a decimal numeric entity. For example, `é` becomes `é`, `©` becomes `©`, `—` becomes `—`, and 😀 becomes `😀`. Use extended mode when you need a pure ASCII output or when working with tools or databases that do not handle multibyte characters reliably.
Developers sometimes search for the same task as `htmlDecode`, `htmlEncode`, HTML escape, HTML unescape, encode HTML, or decode HTML. The wording differs, but the goal is the same: safely convert between readable characters and their HTML entity representation.
Round-trip example in basic mode:
Round-trip example in extended mode:
HTML entity encoding and URL encoding are two completely different mechanisms that serve different purposes and produce different output. They are often confused because both transform special characters into an alternative representation.
HTML entity encoding is for HTML documents. It replaces characters that have a special meaning in HTML markup with entity sequences that the HTML parser treats as text content. The result is still readable text — `&` visually renders as `&` in a browser.
URL encoding (percent encoding) is for URLs. It replaces characters that are unsafe or reserved in a URL with percent-encoded byte sequences. A space becomes `%20`, an ampersand becomes `%26`, a less-than sign becomes `%3C`.
Comparison of the same characters in both systems:
If you paste HTML-encoded text into a URL encoder it will encode the entity characters themselves (the `&`, `;`, `#`), which is almost never what you want. Use each tool only for its intended context: HTML entities for HTML content, percent encoding for URLs.
Need to encode or decode a URL instead of HTML text? Use the URL Encoder / Decoder. Use this page for HTML entity decoding, HTML entity encoding, and converting HTML encoded text back to readable text.
HTML entity encoding (this tool) converts characters into their HTML entity equivalents and reverses the process. It does not add, remove, or reorder any HTML elements. The structure of the document is preserved; only the representation of special characters changes.
HTML cleaning is a different operation that strips or rewrites HTML markup — removing unwanted tags, normalising attributes, or sanitising potentially dangerous content. A cleaner might turn `<b onclick="...">bold</b>` into `<b>bold</b>` or just `bold`, depending on its rules.
This tool does not clean HTML. If you paste raw HTML into the encoder, it encodes the angle brackets and other reserved characters in the markup, turning `<p>Hello</p>` into `<p>Hello</p>`. It does not inspect, remove, or restructure any element.
Similarly, this tool is not a text cleaner. It does not strip extra whitespace, remove diacritics, or normalise line endings. Its only job is to encode and decode HTML entities.
An HTML entity decoder turns escaped HTML entities such as `&`, `<`, `>`, `"`, and `'` back into readable characters. An HTML entity encoder does the reverse: it converts text characters that have a special meaning in HTML — such as `&`, `<`, `>`, `"`, and `'` — into safe HTML entity sequences. This page works as both an HTML decode online tool and an HTML encode online tool, with basic and extended encoding options, all in your browser.
HTML entities are special text sequences that represent characters in HTML source code. They begin with `&` and end with `;`. Named entities use a readable name such as `&` (ampersand), `<` (less-than), `©` (copyright sign), or `—` (em dash). Numeric entities use a decimal or hexadecimal Unicode code point: `©` and `©` both produce the copyright sign ©. Entities exist because certain characters — especially `<`, `>`, and `&` — have reserved meanings in HTML markup and must be escaped to appear as literal text.
Encode HTML entities any time you are embedding plain text in an HTML document and that text might contain characters reserved by HTML. The most important cases are: displaying user-generated content on a web page, where escaping reserved HTML characters can help prevent text from being interpreted as markup, embedding code snippets in blog posts or documentation, constructing HTML email templates, and storing text in CMS fields where HTML is expected. Use basic mode for most web content; use extended mode when you need pure ASCII output or maximum compatibility with older systems.
Decode HTML entities when you receive HTML-escaped text and need the original characters back. Common situations include: API responses that return escaped strings such as `Tom & Jerry`, double-encoded CMS content where `&lt;` should really be `<`, RSS or Atom feed entries where text content is entity-encoded, and log lines containing escaped query parameters. This tool decodes both named entities and numeric entities (decimal and hexadecimal). You can also think of this as using an HTML unescape online tool, a browser-based htmldecode helper, or a way to convert HTML entities to text.
To unescape HTML means to decode HTML entities back into their original readable characters. For example, `&` becomes `&`, `<` becomes `<`, and `>` becomes `>`. This is useful when copied text, API output, CMS content, or source code contains escaped HTML that you want to read as normal text.
`htmldecode` is a developer-style way to describe decoding HTML entities back to normal text. In JavaScript, PHP, and other programming contexts, people often use names like htmlDecode, htmlEncode, HTML escape, and HTML unescape for the same kind of conversion. This tool lets you do that conversion online without writing code.
These are the five HTML entities for the reserved characters that have special meaning in HTML markup. `&` represents the ampersand character `&`, which starts every HTML entity. `<` represents the less-than sign `<`, which opens HTML tags. `>` represents the greater-than sign `>`, which closes HTML tags. `"` represents the double-quote character `"`, which delimits HTML attribute values. `'` (or `'` in HTML5) represents the apostrophe / single-quote character `'`, also used in attribute values. All five must be escaped wherever they appear as literal text content.
Named entities use a human-readable name such as `&`, `©`, or `—`. Numeric entities use a Unicode code point in decimal (`©` for ©) or hexadecimal (`©` for ©). Named entities are easier to read and write, but only a predefined set of names is standardised by HTML. Numeric entities can represent any valid Unicode character, including emoji and characters from any script, even if no named entity exists for them. Extended mode in this encoder uses decimal numeric entities for all non-ASCII characters.
No, they are completely different. HTML entity encoding replaces characters with entity sequences for use in HTML documents — for example `&` becomes `&`. URL encoding (percent encoding) replaces characters with percent-encoded byte sequences for use in URLs — the same `&` becomes `%26`. Each scheme is only valid in its own context. Applying URL encoding to HTML-encoded text would encode the `&` and `;` of the entity itself, producing garbage. Always use the right tool for the right context. Use this page for HTML entity decoding, HTML entity encoding, and converting HTML encoded text back to readable text.
No. HTML entity encoding (this tool) converts characters to and from entity representation without adding, removing, or restructuring any HTML elements. HTML cleaning is a different operation that strips unwanted tags, sanitises attributes, or normalises markup. This tool does not inspect or modify HTML structure in any way — it only encodes and decodes the text representation of characters.
No. The decoded output is displayed as plain text inside a read-only text area. The tool never uses innerHTML, dangerouslySetInnerHTML, or any other mechanism that would cause the browser to parse or execute the output as HTML. For example, decoding `<script>alert(1)</script>` produces the literal string `<script>alert(1)</script>` visible as text — the script is never executed and no script element is ever added to the DOM.
No. The encoder and decoder run entirely in your browser using pure JavaScript. Your input is never sent to a server, never stored, and never logged. Closing the tab discards everything. That makes the tool safe for sensitive content such as API keys, internal HTML templates, or personal documents you would rather not paste into a remote service.
Zana za mtandaoni za bure za kubadilisha, kusimba na kugeuza maandishi
Badilisha herufi kubwa/ndogo — HERUFI KUBWA, herufi ndogo, Kichwa na zaidi
Badilisha maandishi kuwa kodi ya Morse na kurudi
Chambua msimbo wa Morse kutoka faili za sauti au kipaza sauti
Badilisha maandishi kuwa binary na kurudi
Simbua na kusimbua maandishi ya Base64
Badilisha maandishi kuwa heksadesimali na kurudi
Funga na ufumbue maandishi kwa kutumia siri ya ROT13
Hubadilisha maandishi kuwa herufi za juu za Unicode pale inapowezekana.
Badilisha maandishi kwenye Unicode subscript ambapo inaaungwa mkono
Unda maandishi ya Unicode yenye msalaba ya kunakili na kubandika mara moja
Badilisha picha kuwa mifuatano ya Base64 na URI za data
Encode and decode URL components, query strings, and percent-encoded text