Online Decimal to Hex Convert Tool




About Decimal to Hex (A free online tool to converts Decimal to hexadecimal)

Decimal to Hex tool convert decimal number to hex string. Many times we wants to convert decimal to hex that time we can use PHP provides inbuilt functions dechex().We have to use this function that we can convert decimal number to hexadecimal.Many developers and programmers are using this tools in daily life.

Syntax:
base_convert($decString,10,16);

For Example:

There are two ways to convert a binary number to an hex number using built-in functions:

First Way:

Use intval to convert the decimal string to numeric binary, and then use dechex to convert the numeric binary value to a hexadecimal string:

$decString = "45";
$binNumeric = intval($decString);
$hexString = dechex($binNumeric); // = "2d"

Second Way:

Use base_convert to convert the decimal string directly to an hexadecimal string:

$decString = "45";
$hexString = base_convert($decString,10,16); // = "2d"