Skip to content
PithLab

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

Unicode Character Inspector API

Inspect every character in text: code point, name, category, script, UTF-8/UTF-16 bytes, escapes, and warnings for invisible, bidi-control and look-alike (homoglyph) characters. Can also escape the text or strip invisible characters.

POST /api/v1/tools/unicode-character-inspectorMCP unicode_character_inspectorDeveloper Tools

See every character in your text with its code point, UTF-8 and UTF-16 bytes, escapes and category. Find zero-width, bidi and lookalike characters.

Input

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

input
The text to inspect. (string, up to 20000 characters, required)
action
inspect (per-character details and a summary; up to 1000 code points), escape (the whole text in the chosen escape format), or clean (remove invisible and bidi control characters, normalise odd spaces). (string, one of inspect, escape, clean, default "inspect")
format
Escape format for action=escape: js, python, html, css, or codepoints (U+XXXX list). (string, one of js, python, html, css, codepoints, default "js")
curl https://pithlab.com/api/v1/tools/unicode-character-inspector \n  -H "Authorization: Bearer $PITHLAB_KEY" \n  -H "Content-Type: application/json" \n  -d '{"input":"Pаy​","action":"inspect"}'
Example response
{
  "ok": true,
  "result": {
    "summary": {
      "graphemes": 4,
      "codePoints": 4,
      "utf16Units": 4,
      "utf8Bytes": 7,
      "invisible": 1,
      "bidi": 0,
      "confusable": 1,
      "scripts": [
        "Latin",
        "Cyrillic"
      ],
      "mixedScriptWords": [
        "Pаy"
      ]
    },
    "characters": [
      {
        "char": "P",
        "hex": "U+0050",
        "name": "LATIN CAPITAL LETTER P",
        "category": "Lu",
        "categoryName": "Uppercase letter",
        "script": "Latin",
        "utf8": "50",
        "utf16": "0050",
        "htmlNamed": null,
        "js": "\\u0050",
        "warnings": []
      },
      {
        "char": "а",
        "hex": "U+0430",
        "name": null,
        "category": "Ll",
        "categoryName": "Lowercase letter",
        "script": "Cyrillic",
        "utf8": "D0 B0",
        "utf16": "0430",
        "htmlNamed": null,
        "js": "\\u0430",
        "warnings": [
          "Looks like Latin \"a\""
        ]
      },
      {
        "char": "y",
        "hex": "U+0079",
        "name": "LATIN SMALL LETTER Y",
        "category": "Ll",
        "categoryName": "Lowercase letter",
        "script": "Latin",
        "utf8": "79",
        "utf16": "0079",
        "htmlNamed": null,
        "js": "\\u0079",
        "warnings": []
      },
      {
        "char": "​",
        "hex": "U+200B",
        "name": "ZERO WIDTH SPACE",
        "category": "Cf",
        "categoryName": "Format",
        "script": "Common",
        "utf8": "E2 80 8B",
        "utf16": "200B",
        "htmlNamed": null,
        "js": "\\u200B",
        "warnings": [
          "Invisible character"
        ]
      }
    ]
  }
}