PHP decbin(), dechex() and decoct() Functions

decbin(integer) — This PHP function takes an integer (base-10/decimal) input and converts it to a binary (base-2) number. The largest number that can be converted is 4294967295 in decimal.

dechex(integer) — This PHP function takes an integer (base-10/decimal) input and converts it to a hexadecimal (base-16) number. The largest number that can be converted is 4294967295 in decimal resulting to "FFFFFFFF".

decoct(integer) — This PHP function takes an integer (base-10/decimal) input and converts it to an octal (base-8) number. The largest number that can be converted is 4294967295 in decimal resulting to "37777777777".

 

Try it here. Enter your integer below to calculate its result:

e.g. An input of '192' will produce 11000000 for decbin(),
C0 for dechex() and 300 for decoct()



Function Results
Test Integer:
decbin() Result:
dechex() Result:
decoct() Result: