UTF-32 code unit encoder
Turn text into fixed-width UTF-32 values: “Hi” becomes 00000048 00000069, two units and 8 bytes, and an emoji like U+1F600 stays a single unit, 0001F600. Hex or decimal listings decode back to text too. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Text
- Hi
- Calculation mode
- Encode
- Output format
- Hex
- Result
- 00000048 00000069
- Code units
- 2
- Bytes
- 8
UTF-32 stores every Unicode scalar value in a single fixed-width 32-bit code unit. That one-to-one mapping makes wire formats, memory dumps, and protocol examples easier to reason about than variable-width UTF-8 or surrogate-pair UTF-16 when you need to see each character as a full thirty-two-bit value. This tool encodes plain text into a space-separated list of those units in uppercase eight-digit hex or in plain decimal, and decodes such listings back into readable text.
What a UTF-32 code unit is and how the listing is written
In UTF-32 each Unicode scalar value occupies exactly one 32-bit code unit. The letter H is U+0048 and appears as 00000048 in hex or 72 in decimal; an emoji such as U+1F600 is a single unit 0001F600 rather than a surrogate pair. Encoding walks your input by full code points, never by UTF-16 code units alone, so characters outside the Basic Multilingual Plane count as one entry and four bytes in the response totals.
Decimal format writes the same values as non-negative integers for tools that prefer base ten. Because conversion is pure local parse work with no network or model, the same text always yields the same listing.
Encode, decode, well-formedness, and bad input
Mode defaults to encode: supply plain text and receive the listing in the chosen format. Switch mode to decode when the input is already a list of 32-bit values. Format defaults to hex; set decimal when tokens should be base-ten integers.
On decode, spaces, commas, semicolons, and pipes separate tokens; hex tokens may carry a 0x or U+ prefix, and a continuous hex string whose length is a multiple of eight is accepted without separators for compact dumps. Every token must resolve to a Unicode scalar in the inclusive range zero through U+10FFFF. Invalid mode or format values are rejected before any conversion runs.
What you can do with it
Protocol and binary format documentation
Emit fixed-width UTF-32 hex or decimal listings of sample strings for specifications, packet diagrams, and interoperability notes.
Support and reverse engineering
Decode customer-supplied UTF-32 hex or decimal dumps back to text while rejecting surrogate and out-of-range units.
FAQ
How is UTF-32 different from UTF-16 here?
UTF-32 uses one 32-bit unit per scalar value. Characters outside the BMP stay single units instead of surrogate pairs. Surrogate code points are invalid and rejected.
What happens on a surrogate or out-of-range unit?
No partial listing or text is returned, and the failed call is not charged.
Can I paste continuous hex without spaces?
Yes in decode mode with format hex. The digit length must be a multiple of eight. You may also use spaces, commas, 0x, or U+ prefixes on each token.
Can I get UTF-32 values in decimal instead of hex?
Yes. Choose the decimal format and each character is written as a plain base-ten number: the letter H appears as 72 instead of 00000048. Decoding accepts decimal listings the same way.
How do I turn a UTF-32 hex dump back into text?
Choose decode and paste the values, separated by spaces, commas, semicolons or vertical bars; a 0x or U+ prefix is fine. The listing 00000048 00000069 comes back as “Hi”.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/enc/utf32 \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Hi"}'const res = await fetch("https://api.kit.forhosting.com/enc/utf32", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "Hi"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/enc/utf32",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "Hi"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/enc/utf32", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"Hi"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"Hi"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/enc/utf32", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"text": "Hi"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "enc.utf32",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Surrogate code points and values above U+10FFFF are rejected with a clear invalid_input error instead of silent corruption.
What a UTF-32 code unit is and how the listing is written
The response always includes mode, format, code_units, and bytes (four times the unit count) so you can cross-check length fields in binary layouts.
Encode, decode, well-formedness, and bad input
Values in the surrogate range U+D800 through U+DFFF are illegal in UTF-32 and fail with invalid_input, as do unpaired surrogates found while encoding a JavaScript string that already contains a lone high or low surrogate. Out-of-range numbers, non-hex garbage in hex mode, and empty listings after splitting all fail fast with field-specific messages so clients can correct the request without guessing.
Where to run it and how pricing works
For a one-off inspection—turning a short string into fixed-width UTF-32 hex for a protocol appendix, confirming that an emoji is one code unit of four bytes, or decoding a partner’s decimal listing into readable text—use the free in-browser tool. Tier-A parse work keeps latency low with no container or model cost to re-measure after every deploy. Each successful API call costs $0.002; failed validation, including surrogate units and out-of-range values, is not billed, so probing bad dumps does not drain prepaid balance. Responses are deterministic JSON with the converted result, the resolved mode and format, and counts of code units and bytes. Drop the call into a reverse-engineering notebook, a QA harness that asserts wire-format equality, or a support workflow where customers paste unit lists and you need the string without opening a hex editor.
Integration use cases
Fixture and test data generation
Generate deterministic code-unit lists for unit tests that assert four-byte unit counts, emoji scalars, and decode round-trips.
Technical questions
What does encode mode return?
A space-separated listing of each character as a full 32-bit code unit in uppercase eight-digit hex (default) or decimal, plus code_units and bytes (units × 4).
How much does the API cost?
$0.002 per successful request. The browser tool is free. Invalid input is not charged.