Number Base Converter
Decimal 255
Hexadecimal FF
Binary 11111111
Convert numbers between binary, octal, decimal, and hexadecimal. Supports large numbers and shows all bases simultaneously.
How to Use Number Base Converter
- Enter a number in the input field.
- Select the source base (binary, octal, decimal, or hexadecimal).
- View the converted values in all four bases instantly.
- Click the copy button next to any result to copy it to your clipboard.
What is Number Base Conversion?
Number base conversion translates a number from one positional numeral system to another. A base (or radix) determines how many unique digits are used. Decimal (base 10) uses digits 0 through 9. Binary (base 2) uses only 0 and 1. Octal (base 8) uses 0 through 7. Hexadecimal (base 16) uses 0 through 9 plus A through F. Developers regularly convert between these bases when working with low-level data, memory addresses, bitwise operations, file permissions, and color codes.
How Positional Notation Works
In any positional number system, each digit's value depends on its position. The rightmost digit represents base^0 (always 1), the next represents base^1, then base^2, and so on. For example, the decimal number 255 equals 2*100 + 5*10 + 5*1. In hexadecimal, that same value is FF, which equals 15*16 + 15*1 = 255. In binary, it is 11111111, which equals eight 1-bits summing to 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. This tool performs these calculations instantly for any input value.
Common Use Cases
- Converting hex color codes to decimal RGB values for CSS
- Understanding binary representations for bitwise operations and flags
- Working with octal values in Unix file permissions (chmod)
- Reading memory addresses and debugging hexadecimal dumps
- Analyzing network packets and protocol headers
Why Hex is Popular in Programming
Hexadecimal is widely used in programming because each hex digit maps to exactly 4 binary bits. This means a single byte (8 bits) is always exactly 2 hex digits, making hex a compact and readable way to represent binary data. The color code #FF6600 is far easier to read than its binary equivalent 11111111 01100110 00000000. Memory addresses, MAC addresses, Unicode code points, and hash values are all typically displayed in hex. Most programming languages support hex literals with the 0x prefix (e.g., 0xFF) and binary literals with the 0b prefix (e.g., 0b11111111).
For working with hex colors, try the Color Converter. For binary text encoding, see the Text to Binary Converter. For Unix file permissions in octal, use the Chmod Calculator.