Convert whole numbers between decimal, binary, octal, and hexadecimal instantly. This free base converter supports large integers and is useful for programming, networking, computer science, and digital electronics.
Binary/Hex/Octal Converter
LiveSigned integer (two's complement) view optional
How the Binary/Hex/Octal Converter Works
The converter reads the value entered in one number system and displays the same integer in the other three systems:
255 in decimal = 11111111 in binary = 377 in octal = FF in hexadecimal.
How to Use the Converter
- Choose any field. Enter a decimal, binary, octal, or hexadecimal integer.
- Check the results. The other three fields update automatically.
- Edit another field if needed. You can switch between the four number systems at any time.
Spaces and underscores used for readability are accepted. You can also use
the prefixes 0b for binary, 0o for octal, and
0x for hexadecimal.
Binary to Hexadecimal Conversion
To convert binary to hexadecimal, divide the binary value into groups of four digits, starting from the right. Each four-bit group corresponds to one hexadecimal digit.
Binary 10110110 becomes 1011 0110.
1011 = B and 0110 = 6, so 10110110 base 2 = B6 base 16.
Hexadecimal to Binary Conversion
To convert hexadecimal to binary, replace each hexadecimal digit with its four-bit binary equivalent.
Hexadecimal 2F contains the digits 2 and F.
2 = 0010 and F = 1111, so 2F base 16 = 00101111 base 2.
Why One Hex Digit Always Equals Four Bits
Binary to Octal Conversion
To convert binary to octal, divide the binary value into groups of three digits, starting from the right. Each three-bit group corresponds to one octal digit.
Binary 10110101 becomes 10 110 101.
010 = 2, 110 = 6, 101 = 5, so 10110101 base 2 = 265 base 8.
Binary and Number-System Reference Table
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
Two's Complement: Signed Numbers at a Fixed Bit Width
The unsigned converter above shows negative numbers with a minus sign, which is how humans write them but not how computers store them. Real hardware stores every value in a fixed number of bits and uses two's complement to represent negative numbers without a separate sign symbol: the leftmost bit acts as a sign bit, and a negative value is formed by inverting every bit of the positive value and adding one.
To represent -5 in 8-bit two's complement: start with 5 in binary (00000101), invert every bit (11111010), then add 1 (11111011). So -5 is 11111011 in 8-bit two's complement, or FB in hex.
Use the "Signed integer (two's complement) view" section in the calculator above to convert a signed decimal value to its bit pattern at 8, 16, 32, or 64 bits, or to interpret a binary/hex bit pattern as a signed value at that width. A value that doesn't fit in the chosen width -- for example, 200 at 8 bits, which only holds -128 to 127 -- is flagged rather than silently wrapped.
Why Is Octal Used?
Octal groups binary digits into sets of three instead of four, which made
it a natural shorthand on older systems with word sizes divisible by three
bits. Its most common modern use is Unix and Linux file permissions: a
command like chmod 755 sets read/write/execute permissions
using three octal digits, one each for the owner, group, and everyone else.
Why Is Hexadecimal Used?
Hexadecimal provides a shorter and more readable way to represent binary data. One hexadecimal digit represents exactly four binary digits.
Common uses include:
- Computer memory addresses
- Programming and debugging
- Network and hardware configuration
- HTML and CSS color values
- Digital electronics
Common Input Mistakes
Frequently Asked Questions
What is the hexadecimal equivalent of binary 1111?
Binary 1111 equals hexadecimal F.
How many binary digits equal one hexadecimal or octal digit?
One hexadecimal digit represents exactly four binary digits. One octal digit represents exactly three binary digits.
Can I use 0b, 0o, and 0x prefixes?
Yes. The converter accepts 0b before a binary value, 0o before an octal value, and 0x before a hexadecimal value.
Are lowercase hexadecimal letters accepted?
Yes. Values such as ff and FF represent the same hexadecimal number. Results are displayed using uppercase letters.
Can this converter process large integers?
Yes. It uses exact integer conversion rather than ordinary floating-point calculations, allowing large whole numbers to be converted accurately within practical browser limits.
What happens if a signed value doesn't fit in the chosen bit width?
The signed section reports that the value is out of range for the selected width rather than silently wrapping it -- for example, 200 does not fit in 8-bit signed (-128 to 127).
Is the Binary/Hex/Octal Converter free?
Yes. The Numeros Binary/Hex/Octal Converter is free and does not require registration.
Related Converters and Developer Tools
Browse the complete list of Numeros converters or try:
- Color Converter (HEX/RGB) -- hex color codes use the same base-16 digits this page converts
- Data Storage Converter -- convert bytes, kilobytes, and beyond
- Base64 Encoder & Decoder -- a different encoding used alongside hex in programming
- URL Encoder & Decoder -- percent-encoding uses hexadecimal byte values directly
- Subnet Calculator -- subnet masks are built from binary bit patterns like the ones on this page