# String bytes and code points

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

- Endpoint: `POST https://setget.net/v1/tools/string-escape-bytes` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `string-escape-bytes`
- Page: https://setget.net/tools/string-escape-bytes

## Inputs

- `text` (required, string): The text to inspect.

## Example 1

```json
{"input":{"text":"A€😀"}}
```

Result:

```json
{"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}
```

## Example 2: An accent written as a separate combining character

```json
{"input":{"text":"é"}}
```

Result:

```json
{"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}
```

**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.
