Online Decimal to Octal Convert Tool




About Decimal to Octal (A free online tool to converts Decimal to Octal)

Decimal to Octal tool convert decimal string to octal string. Many times we wants to convert decimal to octal that time we can use PHP provides inbuilt function decoct().We have to use this function that we can convert decimal to octal string.Many developers and programmers are using this tools in daily life.

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

For Example:

There are two ways to convert a decimal string to an octal string using built-in functions:

First Way:

Use intval to convert the decimal string to numeric binary, and then use decoct to convert the numeric binary value to an octal string:

$decString = "15";
$binNumeric = intval($decString);
$octString = decoct($binNumeric); // = "17"

Second Way:

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

$decString = "25";
$octString = base_convert($decString,10,8); // = "31"