String bytes and code points

Show the UTF-8, UTF-16 and UTF-32 bytes and the Unicode code points of a text.

Input

The text to inspect.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/string-escape-bytes \
  -H 'Content-Type: application/json' \
  -d '{"input":{"text":"A€😀"}}'
import json, urllib.request

body = {'input': {'text': 'A€😀'}}
request = urllib.request.Request("https://setget.net/v1/tools/string-escape-bytes", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/string-escape-bytes", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"text":"A€😀"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "string-escape-bytes",
  "input": {
    "text": "A€😀"
  }
}
{
  "input": {
    "text": "A€😀"
  }
}

Endpoint: POST /v1/tools/string-escape-bytes. Over MCP: run_tool with slug: "string-escape-bytes". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
text string yes The text to inspect.

Examples

Input
{
  "text": "A€😀"
}
Result
{
  "characters": 3,
  "code_points": [
    "U+0041",
    "U+20AC",
    "U+1F600"
  ],
  "utf8": "41 e2 82 ac f0 9f 98 80",
  "utf16le": "41 00 ac 20 3d d8 00 de",
  "utf32le": "41 00 00 00 ac 20 00 00 00 f6 01 00",
  "bytes": {
    "utf8": 8,
    "utf16le": 8,
    "utf32le": 12
  },
  "ascii": false
}

An accent written as a separate combining character

Input
{
  "text": "é"
}
Result
{
  "characters": 2,
  "code_points": [
    "U+0065",
    "U+0301"
  ],
  "utf8": "65 cc 81",
  "utf16le": "65 00 01 03",
  "utf32le": "65 00 00 00 01 03 00 00",
  "bytes": {
    "utf8": 3,
    "utf16le": 4,
    "utf32le": 8
  },
  "ascii": false
}

Questions

Why is the byte count larger than the character count?
UTF-8 uses one byte for plain ASCII and two to four for everything else. UTF-16 uses two bytes, or four for characters beyond U+FFFF such as emoji.
Two texts look the same but differ. How can I tell why?
Compare their code points. Common causes are a combining accent in place of a single accented letter, a non-breaking space (U+00A0) or a zero-width character (U+200B).
Which byte order is shown?
Little-endian for UTF-16 and UTF-32, lowest byte first, with no byte order mark.