Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

HTML Entity Encoder/Decoder API

Escape text as HTML entities, or decode named (&), decimal (&) and hex (&) character references back to text.

POST /api/v1/tools/html-entity-encoder-decoderMCP html_entity_encoder_decoderDeveloper Tools

Escape text for safe use in HTML, or decode entities like &, © and 😀 back to characters. Optional named or numeric encoding of non-ASCII text.

Input

Send these as a JSON object. Unknown fields are rejected.

input
Text to encode, or HTML with entities to decode. (string, required)
mode
encode or decode. (string, one of encode, decode, required)
encoding
When encoding: basic (only & < > " '), named (also every non-ASCII character, as a named entity where one exists) or numeric (also every non-ASCII character as &#xHEX;). (string, one of basic, named, numeric, default "basic")
curl https://pithlab.com/api/v1/tools/html-entity-encoder-decoder \n  -H "Authorization: Bearer $PITHLAB_KEY" \n  -H "Content-Type: application/json" \n  -d '{"input":"<a href=\"/\">Café & Co</a>","mode":"encode","encoding":"named"}'
Example response
{
  "ok": true,
  "result": {
    "output": "&lt;a href=&quot;/&quot;&gt;Caf&eacute; &amp; Co&lt;/a&gt;"
  }
}