Number Base Converter (binary, octal, decimal, hex)
Pick a source base, type a value, and see equivalents in binary, octal, decimal, and hex. Useful for programming, networking, and electronics.
- Binary (2)
- 11111111
- Octal (8)
- 377
- Decimal (10)
- 255
- Hexadecimal (16)
- FF
How it works
How positional number bases work
Every base uses positional notation: the rightmost digit is baseโฐ = 1, the next is baseยน, then baseยฒ, and so on. In decimal, '255' means 2ร100 + 5ร10 + 5ร1. In binary, '11111111' means 1ร128 + 1ร64 + ... + 1ร1 = 255. The same number, different bases.
Hexadecimal uses 0-9 and A-F to fit 16 values per digit. 'FF' = 15ร16 + 15ร1 = 255. Octal uses 0-7 (3 bits per digit), and binary uses just 0 and 1. The conversion is mechanical โ convert to decimal then back to the target base โ and the calculator does it for you for any non-negative integer.
When you'll use each base
Binary (base 2): low-level computer work โ bit fields, masks, embedded firmware. Reading register layouts, debugging at the hardware level.
Octal (base 8): Unix file permissions (chmod 755 = rwxr-xr-x), some legacy file formats. Less common today.
Decimal (base 10): everything humans count. The default for normal arithmetic.
Hexadecimal (base 16): most common in software โ colors (#FF6B35), memory addresses (0x7fff...), MAC addresses, byte representations of binary data, encoded hashes.
Quick reference
1 byte = 8 bits = 2 hex digits = 256 values (0-255). 1 hex digit = 4 bits = 16 values. 1 octal digit = 3 bits. Hex 'FF' = decimal 255 = binary 11111111. Hex '100' = decimal 256. Hex 'FFFF' = decimal 65535 (max for 16-bit unsigned). Hex 'FFFFFFFF' = decimal 4294967295 (max for 32-bit unsigned).
Frequently asked questions
โบIs hex case-sensitive?
Both 'ff' and 'FF' decode to the same value. We display uppercase by convention.
โบCan I enter negative numbers?
Yes, prefix with '-'. The calculator displays each base's representation with the sign preserved (e.g., -255 โ -FF in hex).
โบWhat's the maximum value?
Limited by JavaScript's safe integer range (about 2โตยณ). For larger values, use BigInt-aware tools.
โบHow do I read 0x prefix or 0b prefix?
Strip the prefix before entering. '0xFF' โ just 'FF' with hex selected. '0b1010' โ '1010' with binary selected.
โบWhy does Unix chmod use octal?
Permissions have three groups (owner/group/other) of three bits each. Each group's 3 bits map cleanly to one octal digit, so 755 = 111 101 101 = rwx r-x r-x.
โบCan I convert fractional values?
Not yet โ only non-negative integers are supported. We may add fixed-point support later.
โบWhat if I see 'invalid for base'?
You typed a character that's not allowed in the chosen base. Hex allows 0-9 and A-F; binary only 0 and 1; etc.
โบIs the data sent anywhere?
No. Conversion runs locally.
Related tools
Last updated: