🏷️

HTML Entity Encoder & Decoder

Convert text to HTML entities (& < >) and decode them back, named and numeric.
HTML Encode 📂 Encode 👤 ToolWorld 🏷️ v1.1.12
Loading...
Encode: plain text → entities
Plain text {chars} chars / {words} words / {lines} lines
Entity result

How to Use

📖 Tool Introduction


The HTML Entity Encoder and Decoder is a free online escaping helper that moves back and forth between plain text and HTML entities. Whenever you want to paste a snippet of source code or an explanation containing angle brackets directly into a web page without the browser interpreting them as markup, you must escape the less-than sign, greater-than sign, ampersand and quotes into named entities such as < > & " and '. Conversely, when you copy a chunk of source littered with sequences like &nbsp; from a page, you want a single click to bring it back to readable text. The tool ships with a practical named-entity table covering copyright, trademark and ellipsis, and it also handles both decimal &#NNNN; and hexadecimal &#xNN; numeric entities in both directions. You may optionally turn non-ASCII characters into numeric entities too, which keeps pages with legacy encodings rendering safely. The signature feature is the circular swap button in the middle: one click exchanges the contents of the two panels and flips the direction between encoding and decoding at the same time, which makes repeated round-trip debugging effortless. Every conversion happens locally in the browser and nothing is ever uploaded. This matters a lot when you are preparing documentation that contains raw markup, because a single unescaped angle bracket can make a whole paragraph vanish from the rendered page. Writers migrating old static pages, and developers copying example code out of chat tools, reach for this converter several times a day; the swap button means they can even paste an already-escaped string and immediately walk it back to the original without touching any menu. Because unknown entities are left untouched instead of being deleted, you can feed in snippets taken straight from real frameworks without risking accidental data loss. The whole round trip from paste to safe copy usually takes less than five seconds, and because the result is delivered as plain escaped text you can drop it straight into any template, comment field or code sample without an extra cleaning step.

✨ Key Features


  • Named entities: covers & < > " ' and friends
  • Numeric entities: both decimal &#NNNN; and hexadecimal &#xNN;
  • One-click swap: the round middle button exchanges panels and flips direction
  • Optional expansion: encode non-ASCII characters as numeric entities
  • Lossless decode: unknown entities are kept verbatim, nothing is dropped
  • Fully local: computed in the browser, private by design

📝 How to Use


  1. Confirm whether you are in encode or decode mode
  2. Tick the numeric-entity option if you also need non-ASCII escaped
  3. Paste text or an entity string into the left input area
  4. Click Convert and read the result on the right
  5. Use the middle swap button to feed the result back as new input

⚠️ Notes


  • Order matters: the ampersand must become & first, or later entities break
  • Unknown names: unrecognised named entities stay untouched instead of erroring
  • Code-point range: numeric entities are validated; out-of-range values stay as-is
  • Minimal escaping: by default only the five dangerous characters are escaped
  • Not sanitiser: this is not an XSS filter, still treat output safely

Related

⏫︎