Skip to content

bin2oct

Convert a binary string to an octal string.

v = bin2oct(b, p)

Returns the octal representation of binary string b. Optional p zero-pads to that minimum length.

bin2oct('1001') % '11'
  • bin2dec — Convert a binary string to a decimal number.
  • bin2hex — Convert a binary string to a hexadecimal string.