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

FieldTypeRequiredDescription
textstringrequiredThe text to entity-encode, or the entity-encoded string to decode.
mode"encode" | "decode"requiredWhether to encode plain text into HTML entities or decode entities back to text.
encodeNonAsciibooleanoptionalEncode mode only: also escape non-ASCII characters as hexadecimal numeric references (e.g. 😀 becomes &#x1F600;).

Response

FieldTypeRequiredDescription
resultstringrequiredThe 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": "&lt;p class=&quot;tip&quot;&gt;Tom &amp; Jerry — &quot;5 &gt; 3&quot; © 2026&lt;/p&gt;"
  }
}

Use the free HTML Entity Encoder/Decoder in your browser, read the HTML Entity Encoder/Decoder guide, or import the full OpenAPI specification.