Online Binary To Octal Convert Tool




About Binary to Octal (A free online tool to converts binary to octal)

Binary to Octal tool convert binary number to octal. Many times we wants to convert binary to octal that time we can use PHP provides inbuilt functions bindec() and decoct(). We have to use two functions that we can convert binary number to octal.Many developers and programmers are using this tools in daily life.

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

For Example:

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

First Way:

Use bindec to convert the binary number to numeric binary, and then use decoct to convert the numeric binary value to an octal number:

$binString = "111100";
$binNumeric = bindec($binString);
$octString = decoct($binNumeric); // = "74"

Second Way:

Use base_convert to convert the binary number directly to an octal number:

$binString = "11001100";
$octString = base_convert($binString,2,8); // = "314"