Home

HEX ↔ ASCII / C array

Convert between hex and text, and generate a round-trippable uint8_t array.

Input
Pick text, HEX or a C array as input — get HEX, text, a paste-ready uint8_t array and a hexdump.

In UTF-8 a CJK character takes 3 bytes; Latin-1 is one byte per character, handy for inspecting raw bytes.

12 bytes

Result
HEX
48 65 6C 6C 6F 20 E6 B8 A9 E5 BA A6
Text
Hello 温度
C array
Paste it straight into C; paste this output back into the C array input to read it again.
const uint8_t buf[] = {
  0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x20, 0xE6, 0xB8, 0xA9, 0xE5, 0xBA, 0xA6,
};
Hexdump
00000000  48 65 6C 6C 6F 20 E6 B8  A9 E5 BA A6              |Hello ......|
Notes

Everything is computed locally in your browser — nothing is uploaded.

HEX and the C array always work on bytes; only the text view depends on the encoding.

The C array input mode parses a uint8_t array declaration copied straight out of your code, and ignores comments.

The hexdump follows the xxd layout: offset + 16 bytes per line + |printable ASCII|.