Decodex

Convert hex to Base64 without encoding the hex digits as text

The input 00ff41 can lead to AP9B or MDBmZjQx. Compare the two byte sequences and pick the one required by the receiving format.

Establish what the six digits represent

In hexadecimal notation, two digits describe one byte. The string 00ff41 can describe the three bytes 00, FF and 41. Typing the six digits into a text encoder instead supplies six ASCII characters, each with its own byte value.

Compare both results side by side

The first row parses the hex notation. The second encodes the digits literally. In Node.js, Buffer.from("00ff41", "hex").toString("base64") produces the first row. Enter 00ff41 in the Decodex text encoder to reproduce the second.

Input bytes and Base64 output
InputBytes in hexadecimalBase64
0x00 0xFF 0x4100 FF 41AP9B
"00ff41" · ASCII30 30 66 66 34 31MDBmZjQx

Check the protocol length

If the device specification calls for a three-byte field, verify the decoded length before sending it. Validate complete pairs and the allowed hex digits when implementing an input field. Some library functions stop at the first invalid pair and return a shorter result.

Open the text encoder

Related guides

References

More online tools

Convert images, test your keyboard, and use other handy tools in your browser.

Explore Altomono tools