Text Cleaner
Sanitize copied text: strip HTML, smart quotes, URLs, emails, emojis, and extra whitespace.
Open ToolSafely encode reserved HTML characters or decode named and numeric HTML entities.
| Character | Named Entity | Numeric Decimal | Purpose |
|---|---|---|---|
& | & | & | Ampersand |
< | < | < | Opening angle bracket |
> | > | > | Closing angle bracket |
" | " | " | Double quotation mark |
' | ' | ' | Single quote / apostrophe |
Each output panel above updates locally in real time as your text changes. Here is what every metric or transformation produced by HTML Entity Encoder & Decoder represents:
An HTML Entity Encoder & Decoder translates reserved markup syntax (`<`, `>`, `&`, `"`, `'`) and international characters into character entities for safe web rendering, or converts entities back into readable Unicode glyphs.
Many naive web decoders convert entities by assigning strings into `element.innerHTML` and reading `textContent`—a risky anti-pattern that can trigger embedded event handlers or scripts when decoding untrusted user snippets. This utility parses entities strictly via safe character-map lookup.
Encoding offers three levels: `Encode Special HTML Chars` escapes only the five critical HTML delimiters (`&`, `<`, `>`, `"`, `'`); `Encode Special + Non-ASCII` preserves those five reserved entities while turning any Unicode code point above 127 into decimal (`&#...;`); `Encode Numeric Hex` turns reserved symbols and non-ASCII characters into uppercase hexadecimal (`&#x...;`).
Choosing `Decode HTML Entities` scans regex matches for named references (covering currency `€`, `£`, `¥`, punctuation `–`, `—`, `…`, quotes, arrows, and copyright/trademark signs), decimal `{`, and hex `🚀` codes via `String.fromCodePoint()` without building live DOM nodes.
Encodes codepoints via `Array.from(str)` and `codePointAt(0)` so supplementary-plane emojis above `U+FFFF` map as single accurate entities rather than broken UTF-16 surrogate pairs.
Decoding guards code point bounds (`0 <= cp <= 0x10FFFF`) and returns unrecognized entities unchanged instead of crashing or discarding valid text.
| Character | Named Entity | Decimal / Hex Entity |
|---|---|---|
| & | & | & / & |
| < | < | < / < |
| > | > | > / > |
| " | " | " / " |
| ' | ' | ' / ' |
| © / — / € | © / — / € | © / — / € |
Explore Next: Text Cleaner if you want to strip HTML tags outright instead of escaping them • URL Slug Generator to sanitize accented titles into clean web URLs • Browse all 30 text tools
Input: <a href="https://example.com?a=1&b=2">5 < 10</a>
Output / Insight: Encode Special HTML Chars outputs `<a href="https://example.com?a=1&b=2">5 < 10</a>`.
Input: AT&T — © 2026 🚀
Output / Insight: Decode HTML Entities restores "AT&T — © 2026 🚀" directly inside plain text.
Both encode apostrophes, and `'` works universally across HTML4, XHTML, and HTML5 parsers alike (the decoder recognizes both `'` and `'`).
Yes. Our decoder never inserts output into live DOM markup via `innerHTML`, so script tags or `onerror` attributes remain completely inert strings.
On modern UTF-8 websites, escaping only `& < > " '` keeps readable text clean; use Non-ASCII or Hex encoding only when transmitting UTF-8 symbols into strict ASCII-only email or legacy XML templates.
Yes. Valid hexadecimal (`🚀`) and decimal (`🚀`) references up to `U+10FFFF` convert via `String.fromCodePoint()`.
Sanitize copied text: strip HTML, smart quotes, URLs, emails, emojis, and extra whitespace.
Open ToolGenerate clean, lowercase, Unicode-transliterated SEO URL slugs in single or batch mode.
Open ToolSearch and replace plain strings, whole words, or RegEx patterns with live match counts.
Open ToolTrack characters with and without spaces, grapheme clusters, emojis, and platform limits.
Open Tool