Text Tools
Convert text to a C-style hex array
Text to Hex Array rewrites the bytes of pasted text as lowercase, 0x-prefixed hex values separated by commas, so hello becomes 0x68, 0x65, 0x6c, 0x6c, 0x6f, the literal form used to embed byte strings in C and Arduino sketches. Developers paste payloads they want to ship as constant arrays in firmware, and prototype byte patterns before writing source by hand. The text is converted to UTF-8 first, so accented letters and emoji give their real bytes, and hex digits stay lowercase throughout.
How to use Text to Hex Array
- Open Text to Hex Array in the Toolbox101 app.
- Type or paste the string into the
Inputbox. - Read the
Outputbox: each byte appears as a 0x-prefixed value in lowercase hex, separated by commas. - Click
Copy, then wrap the result in braces in your source, for exampleconst uint8_t data[] = { 0x68, 0x69 };.
Worked example
Text to Hex Array returns the output below for this input.
Input
helloOutput
0x68, 0x65, 0x6c, 0x6c, 0x6fCheck it yourself: open Text to Hex Array and enter the same input.
Frequently asked questions
What is a C-style hex array?
It is a way to spell a byte sequence in C-family source: each byte written as 0x followed by two hex digits, separated by commas. The output drops straight into an array initializer such as const uint8_t payload[] = { 0x68, 0x69 };, which is how embedded projects ship fixed strings, keys, and message payloads without a runtime encoder.
How are non-ASCII characters written?
As their UTF-8 bytes, which is what a C string literal in a UTF-8 source file contains. ASCII gives the single-byte values you expect, é gives 0xc3, 0xa9, and an emoji gives four bytes. Every value fits in one byte, so the array works as uint8_t data.
How is this different from ASCII to Hex?
Both write each character's hex value, but ASCII to Hex joins the values with spaces and no 0x prefix (hello is 68 65 6c 6c 6f) while this tool emits the C-ready form 0x68, 0x65, 0x6c, 0x6c, 0x6f. Use the first for reading hex dumps and the array form when the bytes go into C-family source.
Use Text to Hex Array now
Runs in your browser. Nothing you type is uploaded.