Binary to HEX Converter - A bin2hex Tool

Binary to HEX conversion is need if you want to open any non text file into a text editor to inspect issues like, hidden characters, corrupted UTF-8 sequences, corrupted file identifiers. This page allows you to learn and test the binary to HEX conversion process.

What is HEX?

HEX, hexadecimal, is a number presentation system that uses 16 values per digit, base 16. Those 16 values are represented with 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. An integer presented in the decimal system can be easily can easily converted into the HEX system. For example:

Dec.    HEX
 7  -->   7
10  -->   A
15  -->   F
16  -->  10
31  -->  1F
32  -->  20

How to perform binary to HEX conversion?

Performing a binary to HEX conversion is to take the input string or file, treat it as a sequence of bytes, and convert each byte into two HEX digit according to the byte value. In PHP, this can be done easily with the bin2hex() function:

  • bin2hex(string) - Returns the HEX presentation of the input string.

To help you learn and test binary to HEX conversion, has designed this online testing page. All you need to do is to enter the testing string in the form below and click the Start button. The converted string will be presented in the result area.


Popup Windows Tutorials

20 tutorials on different ways to create and test popup windows created in JavaScript: Page unload popups, Pop re-open on close, ...

200+ PHP Script Tutorials

Each tutorial answers one commonly asked PHP programming question with a short, but precise and clear PHP script.