---
title: "HTML Escape action for ActionClip"
canonical_url: "https://actionclip.app/actions/html-escape"
document_type: "standalone_action"
official: true
action_count: 1
catalog_schema_version: 1
catalog_revision: "2026-08-21.1"
catalog_published_at: "2026-08-20T18:50:00Z"
---

# HTML Escape action for ActionClip

Escape HTML special characters in selected text.

## What it does

Encodes ampersands, angle brackets, double quotes, and apostrophes in the safe order needed for embedding text in HTML.

## Action details

| Field | Value |
| --- | --- |
| Category | Developer Tools |
| Action type | JavaScript |
| Result | Replace or copy text |
| Internet | Not required |

## Action and outcome

| Action | Outcome |
| --- | --- |
| **HTML Escape** — Selected text: <p title="A&B">It's ready.</p> | &lt;p title=&quot;A&amp;B&quot;&gt;It&#39;s ready.&lt;/p&gt; |

## How to escape HTML special characters in selected text with ActionClip

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

## Requirements

No setup required.

## Privacy

Runs locally in ActionClip’s JavaScript sandbox. Selected text does not leave your Mac.

## Action configuration

````javascript
function run(selected_text) {
  return selected_text
    .replace(/&/g, "&amp;")
    .replace(/</g, "&lt;")
    .replace(/>/g, "&gt;")
    .replace(/"/g, "&quot;")
    .replace(/'/g, "&#39;");
}
````

## Links

- [HTML listing](https://actionclip.app/actions/html-escape)
- [Download action definition](https://actionclip.app/actions/html-escape.actionclip)
- [Browse Developer Tools actions](https://actionclip.app/marketplace#marketplace-developerTools)
- [All Marketplace listings](https://actionclip.app/marketplace)
