Online Hexadecimal to Binary Convert Tool




About Hexadecimal to Binary (A free online tool to converts Hexadecimal to Binary)

Hexadecimal to Binary tool convert Hexadecimal string to binary number. Many times we wants to convert binary to Hexadecimal that time we can use PHP provides inbuilt functions hexdec() and decbin(). We have to use two functions that we can convert hexadecimal string to binary number.Many developers and programmers are using this tools in daily life.

Syntax:
base_convert($string,2,16);

For Example:

There are two ways to convert a hexadecimal string to binary number using built-in functions:

First Way:

Use hexdec to convert the hex string to binary, and then use decbin to convert the numeric binary value to a binary string:

$hexString = "2f";
$binNumeric = hexdec($hexString);
$binString = decbin($binNumeric); // = "101111"

Second Way:

Use base_convert to convert the binary number directly to an hexadecimal string:

$hexString = "fff";
$binString = base_convert($hexString,16,2); // = "111111111111"