Number Base Converter
Enter a number in any base and get the equivalent in binary (base 2), octal (base 8), decimal (base 10) and hex (base 16).
11111111
377
255
FF
What is number base conversion?
Number base conversion translates a value from one numeral system to another. All computers store data as binary (base 2), but developers interact with numbers in decimal (base 10) for everyday values, hexadecimal (base 16) for memory addresses and colour codes, and octal (base 8) for Unix file permissions. Understanding base conversion means you can read raw memory dumps, manipulate bitfields, and work with system-level values without confusion.
The four number bases developers use
- Binary (base 2): Only the digits 0 and 1. Every value in a computer is ultimately stored as binary bits. Used in bitwise operations (
&,|,^,<<,>>), network subnet masks, and hardware register maps. The decimal value 255 is11111111in binary — eight bits all set to 1, which is why a byte maximum is 255. - Octal (base 8): Digits 0–7. Each octal digit represents exactly three binary bits, making it a compact way to express binary values. Used almost exclusively in Unix/Linux file permissions:
chmod 755meansrwxr-xr-x, where 7 = 111 (read+write+execute), 5 = 101 (read+execute), in binary. - Decimal (base 10): Digits 0–9. The base humans use naturally. Port numbers, IP address octets, array indices, and most user-visible numbers are decimal.
- Hexadecimal (base 16): Digits 0–9 and letters A–F. Each hex digit represents exactly four binary bits (a nibble), making hex a concise way to express binary data. Memory addresses, SHA hashes, RGB colour values (
#FF5733), UUID values, and hardware identifiers are all written in hex.
Hex colour codes explained
CSS hex colours like #FF5733 are three pairs of hex digits representing the red, green, and blue channels: FF = 255 red, 57 = 87 green, 33 = 51 blue. Each channel is one byte (0–255 in decimal, 00–FF in hex). The shorthand #F53 expands to #FF5533 by doubling each digit. Converting between hex and decimal directly is how you calculate the RGB equivalent of a hex colour code.
How to use this tool
- Enter a number in the input field.
- Select the base of your input number (binary, octal, decimal, or hex) using the base buttons.
- The conversions to all other bases update automatically.
- Copy the result you need using the copy button next to each value.
Bitwise operations and binary
Bitwise operations work directly on individual binary bits and are common in systems programming, network code, and performance-sensitive algorithms. Understanding binary representation makes these operations intuitive: 255 & 15 in decimal is 11111111 & 00001111 = 00001111 = 15 — it masks the lower four bits. 1 << 4 is binary 1 shifted four places left, giving 10000 = 16 in decimal. Converting your values to binary before applying bitwise operations makes the result predictable and easy to verify.