Text to Hex Bytes Converter
Turn text into its raw byte array, shown in hex — useful for constructing test payloads or comparing against a packet capture.

Built by
Swapnil SanghviFull-Stack Web Developer & WordPress Developer
Swapnil Sanghvi is a full-stack web and WordPress developer, UI designer, and full-time freelancer who builds and maintains Hex Calculator.
Further reading: Character encoding — Wikipedia
How to Convert Text to Hex Bytes
Encode the text as UTF-8, giving one or more bytes per character, then write each byte as 2 hex digits. The result is the exact byte array that text would become if sent over a network connection or written to a file.
Common Mistakes When Building Hex Bytes From Text
- Forgetting punctuation and spaces each take their own byte in the array.
- Assuming a fixed byte count per character instead of UTF-8's variable length.
- Mixing up this byte order with what a specific protocol expects for multi-byte fields.
Limitations
- Text is encoded as UTF-8 bytes before converting to hex, so multi-byte characters (accents, emoji, non-Latin scripts) take up more than 2 hex digits each.
Frequently Asked Questions
What byte encoding does this produce?
UTF-8 — the standard for encoding text into bytes almost everywhere, matching what you'd see if you captured this same text going over a network or into a file.
Why would I need text as a hex byte array?
Building a test payload for an API or protocol, comparing expected output against a packet capture, or documenting exactly what bytes a message should contain.
How many bytes does each character use?
Plain English letters use 1 byte; accented letters and most other scripts use 2-3; emoji typically use the full 4 bytes UTF-8 allows.
Does this include a byte for spaces?
Yes — a space is its own byte (0x20), included in the output just like any visible character.
Can this help me build a request payload by hand?
Yes — convert your text (like an HTTP request line) into its byte form here, then use those exact bytes when constructing a raw request.
Is this the reverse of Hex Bytes to Text?
Yes — that page decodes a hex byte array back into readable text.