Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal.
Last updated: August 2026
Was this tool helpful?
Converting numbers between binary, octal, decimal, and hex
A base converter rewrites the same integer in different radixes: binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). The underlying quantity never changes, only the symbols used to write it. Developers reach for this constantly: reading a color code in hex, inspecting a bitmask in binary, or decoding a file permission in octal.
Why these four bases dominate
Decimal is how humans count. Binary is how hardware stores everything. Hex is a compact way to write binary, since one hex digit maps cleanly to exactly four bits, so a byte is always two hex digits. Octal groups bits in threes and survives mainly in Unix file permissions. Seeing a value in all four at once makes bit patterns obvious.
Example
Convert decimal 255:
Decimal: 255
Binary: 11111111
Octal: 377
Hexadecimal: FFConvert hex 2A:
Hex 2A -> Decimal 42 -> Binary 101010FAQ
What do the prefixes mean? In code, 0b marks binary, 0o marks octal, and 0x marks hex. They tell the parser the base; the digits after them are the actual number.
Is hex case sensitive? No. FF and ff are the same value. Teams just pick one style for consistency.
How do negative numbers work? Plain conversion treats the magnitude and a sign. Two's complement, used by hardware for signed integers, is a separate representation that depends on the bit width. If you are decoding permissions, see the chmod calculator.