Number Base Converter
Type a number in any field — Binary, Octal, Decimal, or Hex — and all other fields update instantly. 100% client-side.
Common Value Reference Table
| Decimal | Binary | Octal | Hex | Char |
|---|
How to Use the Number Base Converter
- Type a number into any field — Binary, Octal, Decimal, or Hex. All other fields update automatically.
- Enable Show Prefix to display the standard programming language prefixes:
0bfor binary,0ofor octal,0xfor hex. - Use the reference table below the input fields for a quick lookup of common values.
- Copy results using the Copy Decimal or Copy Hex buttons.
Understanding Number Bases
Every positional number system is defined by its base (also called the radix), which determines how many unique digits it uses and what value each digit position represents. In decimal (base 10), the digit positions represent powers of 10: ones (100), tens (101), hundreds (102), and so on. In binary (base 2), positions represent powers of 2: 1, 2, 4, 8, 16, 32, 64, 128. All number systems ultimately represent the same values — they just use different notation.
Binary (Base 2)
Binary uses only the digits 0 and 1. It is the language of computers because electronic circuits have two states: on (represented as 1) and off (represented as 0). Every piece of digital data — text, images, programs — is ultimately stored as binary. Binary numbers can be long: the decimal number 255 requires 8 binary digits (11111111). The 8-bit group (one byte) is the fundamental unit of computer memory.
Octal (Base 8)
Octal uses the digits 0 through 7. Each octal digit represents exactly 3 binary digits, making it a compact shorthand for binary. Octal was popular in early computing and is still used in Unix/Linux file permissions (e.g., chmod 755, where 7 = 111 in binary = read+write+execute, 5 = 101 = read+execute). In modern programming, octal literals are written with a 0o prefix in Python and JavaScript.
Hexadecimal (Base 16)
Hexadecimal uses the digits 0-9 and the letters A-F (representing values 10-15). Each hex digit represents exactly 4 binary digits (one nibble), so a byte (8 bits) is always exactly 2 hex digits. This makes hex extremely compact for representing binary data. Hex is ubiquitous in programming: color codes (#FF5733), memory addresses (0x7FFE1234), cryptographic hashes (SHA256 is 64 hex chars), and binary file formats all use hexadecimal notation.
Conversion Examples
Here are some landmark values across all four bases:
- Decimal 255 = Binary 11111111 = Octal 377 = Hex FF (maximum value of one byte)
- Decimal 256 = Binary 100000000 = Octal 400 = Hex 100 (one more than one byte)
- Decimal 65535 = Binary 1111111111111111 = Octal 177777 = Hex FFFF (maximum 16-bit unsigned integer)
- Decimal 65536 = Binary 10000000000000000 = Octal 200000 = Hex 10000
For converting text characters to their numeric codes and then to hex or binary, combine this tool with our Hex ↔ ASCII Converter and Binary ↔ Text Converter.