What is a Number Base?
A number base (or radix) defines how many unique digits are used to represent numbers. The decimal system we use daily has base 10, using digits 0–9. Computers use binary (base 2) internally, while octal (base 8) and hexadecimal (base 16) are commonly used in programming as shorthand for binary.
The Four Bases
- Binary (Base 2) — Uses only 0 and 1. Every value in a computer is ultimately stored in binary. Prefix:
0b(e.g.0b1010= 10). - Octal (Base 8) — Uses digits 0–7. Each octal digit represents exactly 3 binary bits. Used in Unix file permissions (e.g.
chmod 755). Prefix:0o. - Decimal (Base 10) — The standard human number system using digits 0–9.
- Hexadecimal (Base 16) — Uses digits 0–9 and letters A–F. Each hex digit represents exactly 4 binary bits (one nibble). Widely used in programming, color codes, memory addresses, and encoding. Prefix:
0x.
How to Use
Type a number into any of the four fields. All other fields update instantly. The highlighted field shows which base you are currently typing in. Click the copy icon next to any field to copy that value.
The binary nibble display groups binary digits into sets of 4, making it easier to read and convert to hex mentally. The info bar shows the bit length, byte count, and nibble count of the current value.
Common Use Cases
- Color codes — HTML/CSS colors like
#FF5733are hexadecimal. Each pair of hex digits (FF, 57, 33) represents a red, green, or blue channel value from 0–255 in decimal. - Memory addresses — Debuggers and assembly code display memory addresses in hexadecimal (e.g.
0x7FFF5FBFF8A0). - Unix permissions — File permissions like
rwxr-xr-xare stored as octal (755). Each digit represents 3 bits: read, write, execute. - Bitwise operations — Understanding AND, OR, XOR, and shift operations requires reading binary and hex representations of numbers.
- Network subnets — Subnet masks and IP addresses are often expressed in both decimal and binary.
Frequently Asked Questions
Why do hexadecimal numbers use letters?
Hexadecimal needs 16 distinct symbols for digits 0–15. After using 0–9 (10 symbols), the letters A–F represent values 10–15. A=10, B=11, C=12, D=13, E=14, F=15. This is a convention established in early computing and is universally used today.
What is a nibble?
A nibble is 4 bits — half a byte. It can represent values from 0 to 15, which maps perfectly to a single hexadecimal digit (0–F). This is why hex is so convenient: one hex digit = one nibble = 4 bits, and two hex digits = one byte = 8 bits.
What is the largest number this tool can convert?
This tool uses JavaScript's built-in parseInt() and toString(), which operate on 32-bit integers for bases other than decimal. For very large numbers, use a dedicated arbitrary-precision library.