Developer Tools

HTML Unescape

Decode common named and numeric HTML entities.

OfficialOn-device

Download action

What HTML Unescape does

Decodes common typographic and currency entities plus decimal or hexadecimal Unicode references, while leaving unknown or invalid entities unchanged.

CategoryDeveloper Tools
Action typeJavaScript
ResultReplace or copy text
InternetNot required

Action and outcome

HTML Unescape example
ActionOutcome
HTML UnescapeSelected text: &lt;p&gt;Ready &amp; waiting &#x1F44B;&lt;/p&gt;<p>Ready & waiting 👋</p>

Use HTML Unescape

Follow these steps to decode common named and numeric HTML entities with ActionClip.

  1. Select the text you want to use.
  2. Choose HTML Unescape from ActionClip.
  3. Review the result, then replace the selection or copy the new text.

Requirements and privacy

  • Before you start: No setup required.
  • Your selected text: Runs locally in ActionClip’s JavaScript sandbox. Selected text does not leave your Mac.

Action configuration

The definition below is included so you can inspect how the action works before downloading it.

JavaScript definition
function run(selected_text) {
  const named = {
    amp: "&", lt: "<", gt: ">", quot: '"', apos: "'", nbsp: "\u00A0",
    ndash: "–", mdash: "—", hellip: "…", copy: "©", reg: "®", trade: "™",
    euro: "€", pound: "£", yen: "¥", cent: "¢", laquo: "«", raquo: "»",
    lsquo: "‘", rsquo: "’", ldquo: "“", rdquo: "”", bull: "•", middot: "·",
    times: "×", divide: "÷"
  };

  return selected_text.replace(/&(#(?:x[0-9a-f]+|\d+)|[a-z][a-z0-9]+);/gi, (match, entity) => {
    if (entity[0] !== "#") return named[entity.toLowerCase()] ?? match;
    const isHex = entity[1].toLowerCase() === "x";
    const value = parseInt(entity.slice(isHex ? 2 : 1), isHex ? 16 : 10);
    if (!Number.isFinite(value) || value < 0 || value > 0x10FFFF || (value >= 0xD800 && value <= 0xDFFF)) {
      return match;
    }
    return String.fromCodePoint(value);
  });
}