Input
Decimal
Binary (base 2)1111 1111
Octal (base 8)0o377
Decimal (base 10)255
Hexadecimal (base 16)0xFF
8 bits · 1 byte

How number bases work

A number base (or radix) defines how many digits a positional numeral system uses. Hex is the dominant format for memory addresses, color codes, and byte values because one hex digit maps exactly to 4 bits (one nibble), and two hex digits represent one byte.

DecimalBase 10 — digits 0-9, the everyday standard
BinaryBase 2 — 0 and 1, the native language of computers
OctalBase 8 — digits 0-7, early Unix permissions (chmod 755)
HexBase 16 — digits 0-9 and A-F

Reading binary and hex in code

You can separate digits with underscores for readability in many languages: 0b1111_0000, 1_000_000, 0xFF_A0. The copy button here outputs the standard prefix form ready to paste into code.

JS / Python / Go0b1010, 0o755, 0xFF
C / C++0xFF for hex, 0755 (bare leading zero) for octal
SQLX'...' or 0x notation for hex literals

Common conversions for developers

Unix file permissions are written in octal: 755 means rwxr-xr-x (7=111, 5=101 in binary). CSS and HTML colors use hex: #RRGGBB where each channel is one byte (00-FF).

Network masks like 255.255.255.0 are 0xFFFFFF00 in hex. ASCII and Unicode code points are typically shown in hex: the letter A is 0x41 (decimal 65). IPv4 addresses are sometimes written as 32-bit hex integers: 192.168.1.1 = 0xC0A80101.