BaseShift
Number Base Converter
Edit any field — the other three update live. Great for programmers, students, and anyone debugging bitwise math.
Numbers in binary, octal, decimal and hexadecimal
The same value written in base 2, 8, 10 and 16. Hexadecimal uses A to F for the values 10 to 15.
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 10 | 1010 | 12 | A |
| 42 | 101010 | 52 | 2A |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
| 1024 | 10000000000 | 2000 | 400 |
| 4095 | 111111111111 | 7777 | FFF |
255 as FF and 4095 as FFF are the rows worth recognising: hexadecimal maps exactly four binary digits to one hex digit, so 8 bits is always two hex characters and 12 bits always three. That is why colours are written as six hex digits - two each for red, green and blue, each covering 0 to 255. Octal groups three bits instead, which is why Unix file permissions use it: rwx maps neatly onto one octal digit. Binary grows fastest in length, which is precisely why hex exists as a compact way to write it.
Why hex is everywhere in code
Each hex digit (0–F) represents exactly 4 bits, so 1 byte fits in 2 hex digits and a 32-bit word in 8. That makes binary memory and colour values readable at a glance.
Frequently asked questions
What is 255 in binary and hexadecimal?
Binary: 11111111 (eight 1s — all bits set in a byte). Hex: FF. This is the maximum value of an unsigned 8-bit byte, which is why RGB color values max out at 255 and why hex colors go up to FF per channel.
How do I read a hex color like #3A7BF2?
Split it into pairs: 3A (red = 58), 7B (green = 123), F2 (blue = 242). Each pair is a hex byte (00–FF = 0–255). This color is a medium blue with low red, moderate green, and high blue. The color converter shows the RGB and HSL equivalents live.
Why do computers use binary instead of decimal?
Electronic switches have two reliable states: on (1) and off (0). Building circuits that distinguish 10 voltage levels (for decimal) is far harder and more error-prone than distinguishing just 2. Binary is less human-readable but vastly more reliable for hardware.
Related Converters calculators
Last updated: September 6, 2026