Binary Hex Converter
Convert non-negative whole numbers between decimal, binary and hexadecimal, with place-value steps and worked examples for 255 and 2026.
Results
Decimal
Binary
Hexadecimal
You might also need
Educational estimates · not financial advice · free, no signup
Formula / how it works
Decimal to binary: repeatedly divide by 2 and read remainders upward. Binary to decimal: sum the bits × powers of 2. One hex digit equals four bits (0–9, A–F).
Detailed guide
What it is, how to use it, how to read the numbers, common mistakes, a worked example, formulas, and FAQs.
What this calculator is
Computers store numbers in binary, but people usually read them in decimal or hexadecimal. Hexadecimal is shorthand for binary: each hex digit stands for exactly four bits, so a byte is two hex digits. This converter turns a whole number between decimal, binary and hex. Choose the input base, type the value, and read the other two forms. It is intended for non-negative integers, such as byte values, memory addresses, colour channels and flags. It does not handle fractions or negative numbers, and does not show two's-complement representations.
When to use / who it helps
- You are reading a memory address or byte value in hex.
- You are studying computer science number systems.
- You are checking a bitmask or flag value.
- You are converting a colour channel from decimal to hex.
- You are debugging a protocol or file format.
How to use
Steps
- Choose the input base: decimal, binary or hexadecimal.
- Type the value with only valid digits for that base.
- Read the decimal, binary and hexadecimal results.
- Group binary digits in fours to match hex digits.
- Double-check long values by converting back.
- Use another tool for negative numbers or fractions.
How to interpret results
- Binary uses only 0 and 1; hex uses 0–9 and A–F.
- FF in hex is 255 in decimal, the maximum value of one byte.
- Each extra binary digit doubles the range.
- Leading zeros do not change the value.
- Hex letters are case-insensitive in value.
Common mistakes & gotchas
- Typing digits that are invalid for the base, such as a 2 in binary.
- Entering a decimal point or negative sign.
- Reading hex letters as decimal digits.
- Dropping a leading zero when a fixed width is required.
- Confusing the 0x prefix with part of the number.
Worked example
Worked example — 255 and 2026
- 255 in binary is 11111111, which groups as 1111 1111, and each nibble is F, so 255 = FF in hex.
- 2026 ÷ 2 repeatedly gives binary 11111101010.
- Grouping from the right: 0111 1110 1010, which is 7, E, A, so 2026 = 7EA in hex.
- Check: 7 × 256 + 14 × 16 + 10 = 1,792 + 224 + 10 = 2,026.
Result: 255 = 11111111 = FF, and 2026 = 11111101010 = 7EA.
To load the form's own demo values, tap Try example above the Calculate button.
How to calculate / formula
Decimal to binary: repeatedly divide by 2 and read remainders upward. Binary to decimal: sum the bits × powers of 2. One hex digit equals four bits (0–9, A–F).
Frequently asked questions
What is hexadecimal?
A base-16 system using digits 0–9 and letters A–F.
Why do programmers use hex?
It is a compact way to write binary, with four bits per digit.
What is FF in decimal?
255.
Does this handle negative numbers?
No. It is for non-negative integers.
How do I convert hex to binary?
Replace each hex digit with its four-bit pattern.
Are hex letters case-sensitive?
Not in value: ff and FF are the same number.