Byte Array to Hex Converter
Convert a byte array to a hex string, with or without spaces, colons, commas or 0x prefixes, in upper or lower case. Signed Java bytes are handled correctly.
Paste decimal bytes, including negative Java-style values, and get a compact hex string in the layout you need.
new byte[] {...}.More Byte Array Tools
View all 17Negative values such as -1 are signed bytes - they become FF, the same eight bits read as unsigned.
What Is the Byte Array to Hex Converter?
It converts a list of byte values into a hexadecimal string - the compact form used for hashes, keys, MAC addresses and protocol dumps. You choose the separator (none, space, colon or comma), upper or lower case, and whether each byte gets a 0x prefix.
When to Use It
- Turning
Arrays.toString(bytes)output from Java, which prints signed numbers, into readable hex. - Comparing a byte array from code with a hex value in documentation.
- Formatting bytes as a fingerprint such as
AB:CD:EF.
How to Use It
- Paste the bytes: decimal values from 0 to 255, signed values from -128 to -1, binary, Base64 or a code array.
- Choose the separator, case and prefix.
- Copy the hex.
Example
The Java output [-54, -2, -70, -66, 0, 1, 127, -128] becomes CA FE BA BE 00 01 7F 80. A signed byte of -54 is the same eight bits as the unsigned value 202, which is CA in hex.
Understanding the Output
Each byte always becomes exactly two hex digits, with a leading zero where needed (1 becomes 01), so the string can be split back into bytes without separators.
Limitations
Values outside -128 to 255 are rejected, since they do not fit in a byte. For the opposite direction use Hex to Byte Array; to see text as hex, use the Text to Hex Converter.
Frequently Asked Questions
Explore More Tools
Keep going with related categories and our most used tools.