String bytes and code points
Show the UTF-8, UTF-16 and UTF-32 bytes and the Unicode code points of a text.
Input
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
| Name | Type | Required | What 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.
Related tools
- Hex encoder and decoderConvert text to hexadecimal bytes and back, with optional upper case and separators.
hex - Text to binary converterConvert text to binary, octal or decimal byte values and back again.
binary-text - HTML entity encoder and decoderEscape text as HTML entities, named or numeric, or decode entities back to characters.
html-entities - URL encoder and decoderPercent-encode text for use in a URL, or decode it. Works on one value or a whole URL.
url-encode - All hashes at onceCompute every supported hash of one input at once: MD5, SHA-1, SHA-2, SHA3-256 and BLAKE2b.
hash-all - Base32 encoder and decoderEncode text to Base32 (RFC 4648) or decode it back, with or without padding.
base32