Binary Converter – Decimal, Binary, Hex, Octal
Convert between decimal, binary, hexadecimal, and octal number systems.
About This Calculator
Convert between decimal, binary, hexadecimal, and octal number systems. Use the calculator above for instant results.
Understanding Number Bases and Place Value
A numeral system assigns each digit a place value determined by powers of its base. Decimal uses base 10, binary uses base 2, octal uses base 8, and hexadecimal uses base 16. Reading a numeral therefore means multiplying each digit by the power of the base that belongs to its position and adding the results.
For example, binary 101101 is 1×25 + 0×24 + 1×23 + 1×22 + 0×2 + 1 = 45. The same value can be written as 55 in octal or 2D in hexadecimal. The number has not changed; only its written representation has.
Valid digits depend on the base. Binary permits 0 and 1. Octal permits 0 through 7. Decimal permits 0 through 9. Hexadecimal adds A through F for values 10 through 15. A useful shortcut is that one hexadecimal digit corresponds to four binary bits, while one octal digit corresponds to three bits. This makes binary-to-hex and binary-to-octal conversion efficient by grouping bits from the right.
Leading zeros do not change the value of a nonnegative integer: 001011 and 1011 represent the same quantity. They can still matter in computing when a fixed bit width is required, such as an 8-bit byte. Always distinguish the mathematical value from the storage format.
Worked Examples
- Binary: 11111111 | Hex: 0xFF | Octal: 0o377
Answer: 11111111 / 0xFF
- Decimal: 10 | Hex: 0xA
Answer: Decimal: 10
- Decimal: 255 | Binary: 11111111
Answer: Decimal: 255
Repeated division or place values give the same result.
- 42 = 32 + 8 + 2, so binary = 101010.
- 42 = 2×16 + 10, so hexadecimal = 2A.
- 42 = 5×8 + 2, so octal = 52.
Answer: 4210 = 1010102 = 528 = 2A16
For hexadecimal, pad on the left and group four bits: 0011 0101.
- 0011 = 3 and 0101 = 5, giving 3516.
- 1101012 = 5310.
Answer: 1101012 = 5310 = 3516
Who Uses This Calculator?
Convert between number systems.
Computer science coursework.
Digital circuit design.
Understand how computers work.
Common Mistakes to Avoid
❌ Entering hex without prefix
Enter hex as letters and numbers (FF not 0xFF). Select Hexadecimal as the base.
❌ Binary only 0s and 1s
Octal uses 0-7. Hex uses 0-9 and A-F.
❌ Using a digit that the base does not allow
The digit 2 cannot appear in a binary numeral, and 8 cannot appear in octal. Validate every digit before doing place-value arithmetic.
❌ Treating the written digits as a decimal number
Binary 1010 is not one thousand ten. Its place values are powers of 2, so it equals decimal 10.
Frequently Asked Questions
Why binary?
Computers have two electronic states: on (1) and off (0). All data is ultimately binary.
Binary to decimal?
Each bit is a power of 2. 1010 = 1x8 + 0x4 + 1x2 + 0x1 = 10.
Hex uses?
HTML colors (#FF5733), memory addresses, byte values. 2 hex digits = 1 byte.
Why is hexadecimal convenient for binary data?
Because 16 = 24, each hexadecimal digit maps exactly to four binary bits. A byte such as 11111111 becomes FF, which is shorter to read while preserving an exact bit-for-bit relationship.
How do I convert a base-10 integer to binary by hand?
Repeatedly divide the integer by 2, recording each remainder. Continue until the quotient is zero, then read the remainders from last to first. Those remainders are the binary digits from most significant to least significant.
Do leading zeros change the converted number?
Not for the numerical value of a nonnegative integer. Binary 000101 and 101 both equal decimal 5. Leading zeros may still be required when representing a fixed-width computer word.
What does the subscript in 10112 mean?
The subscript states the base. Thus 10112 is binary, while 101110 is decimal. Writing the base explicitly prevents ambiguity when several numeral systems appear in the same problem.
Formula Explorer connections
Interpretation: This relationship converts, summarizes or checks numerical quantities using standard arithmetic and measurement rules. Assumption: Use consistent units, preserve enough significant digits, and round only the final result unless the method states otherwise.