HTML Entity Encoder/Decoder API
Encode and decode HTML entities online. Escape & < > quotes, optionally encode non-ASCII as numeric references — free and client-side.
The HTML Entity Encoder/Decoder is also available as a free REST API. Send a POST request with a JSON body to https://dot.tools/api/tools/html-entities — no authentication, no API key, CORS enabled. Successful calls return { "ok": true, "result": { … } }; failures return HTTP 400 or 422 with an error body.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
text | string | required | The text to entity-encode, or the entity-encoded string to decode. |
mode | "encode" | "decode" | required | Whether to encode plain text into HTML entities or decode entities back to text. |
encodeNonAscii | boolean | optional | Encode mode only: also escape non-ASCII characters as hexadecimal numeric references (e.g. 😀 becomes 😀). |
Response
| Field | Type | Required | Description |
|---|---|---|---|
result | string | required | The entity-encoded or decoded result. |
Example request
curl -X POST https://dot.tools/api/tools/html-entities \
-H 'Content-Type: application/json' \
-d '{
"text": "<p class=\"tip\">Tom & Jerry — \"5 > 3\" © 2026</p>",
"mode": "encode",
"encodeNonAscii": false
}'Sample response
{
"ok": true,
"result": {
"result": "<p class="tip">Tom & Jerry — "5 > 3" © 2026</p>"
}
}Use the free HTML Entity Encoder/Decoder in your browser, read the HTML Entity Encoder/Decoder guide, or import the full OpenAPI specification.