Number base converter
Binary, octal, decimal, hex and any base to 36, with the working shown.
PrivateNo uploadsRuns in your browserBits and two's complement
- Signed value
- 2026
- Unsigned value
- 2026
- Hex, 16 bit
- 0x07EA
- Signed range
- -32768 to 32767
Step by step: decimal to binary
Divide the number by 2, write the remainder, and divide the answer again until it reaches 0. Then read the remainders from the bottom up.
| Divide | Answer | Remainder |
|---|---|---|
| 2026 ÷ 2 | 1013 | 0 |
| 1013 ÷ 2 | 506 | 1 |
| 506 ÷ 2 | 253 | 0 |
| 253 ÷ 2 | 126 | 1 |
| 126 ÷ 2 | 63 | 0 |
| 63 ÷ 2 | 31 | 1 |
| 31 ÷ 2 | 15 | 1 |
| 15 ÷ 2 | 7 | 1 |
| 7 ÷ 2 | 3 | 1 |
| 3 ÷ 2 | 1 | 1 |
| 1 ÷ 2 | 0 | 1 |
Remainders from the bottom up: 11111101010
How it is calculated
Each digit is worth the base raised to its place, counting from 0 at the right. Reading a number means adding those up; writing it in another base means dividing by the new base again and again and keeping the remainders.
1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11₁₀
Fractions work the other way round: multiply the part after the point by the new base, and the whole part of each answer is the next digit. Negative numbers in a fixed number of bits use two's complement: flip every bit and add 1.
-5 in 8 bits: 00000101 → flip 11111010 → add 1 → 11111011

For the computer class
Numbers in every base, side by side.
Lab class. Abdul learns binary in his computer lab.
BeforeLong division on scrap paper
With sdevType once, see every base

Clear at last
The teacher shows each base side by side.

Exam ready
He walks into the exam with a smile.
How to convert between number bases
Type in any box
Type a number in the binary, octal, decimal, hexadecimal or custom base box. The others update at once.
Look at the bits
Pick 8, 16, 32 or 64 bits to see the two's complement pattern, and click bits in the grid to switch them on or off.
Learn the method
The step by step table shows the repeated division that turns your decimal number into binary, octal or hexadecimal.
Good to know
- Prefixes 0x, 0o and 0b are understood in the matching box, and spaces or underscores between digits are ignored.
- Digits allowed: binary 0 and 1, octal 0 to 7, hexadecimal 0 to 9 and A to F.
- Hex is binary in groups of four bits, and octal is binary in groups of three. Turn on Group digits to see it.
- Turn off the signed reading to see 11111111 as 255 instead of -1.
- Ctrl+C with nothing selected copies every base at once.
Where people use it
Homework with steps
Students see each step of the working, ready to copy into a notebook.
Read a colour or memory code
Turn a hex value into a normal number and back.
Signed numbers
See a binary value as signed or unsigned at 8, 16, 32 or 64 bits.
Odd bases
Convert to any base from 2 to 36, like base 36 for short codes.
Text to binary
Want words written as 0s and 1s? Try the text tools.
Case converter
Why this one
It shows the full working, not just the answer, so it helps you learn as well as convert.
- Binary, octal, decimal and hex all at once.
- Very big numbers stay exact.
- Shows the working step by step.
What you can change
- Any base from 2 to 36
- Bit width
- Signed or unsigned
- Group digits
People find this page by searching
- binary to decimal
- decimal to binary
- hex to decimal
- decimal to hex
- number base converter
- binary to hex
- octal to decimal
- base converter with steps
- two's complement calculator
Cite this tool
- APA
sdev.in. (n.d.). Number base converter [Web tool]. https://www.sdev.in/tools/number-base-converter
- MLA
"Number base converter." sdev.in, https://www.sdev.in/tools/number-base-converter.
- Chicago
sdev.in. "Number base converter." https://www.sdev.in/tools/number-base-converter.
- BibTeX
@misc{sdev-number-base-converter, title = {Number base converter}, author = {{sdev.in}}, howpublished = {\url{https://www.sdev.in/tools/number-base-converter}}, note = {Web tool} }
Questions people ask
How do I convert decimal to binary by hand?
Divide the number by 2 and write down the remainder. Divide the answer by 2 again, and keep going until you reach 0. Read the remainders from the last one to the first. The step by step table on this page shows every division for your number.
What is two's complement?
It is how computers store negative whole numbers. In 8 bits, -1 is 11111111 and -128 is 10000000. To make a negative number, flip every bit of the positive number and add 1. The first bit tells you the sign.
Can it convert very large numbers?
Yes. Whole numbers are worked out exactly with big-number maths, so a 100-digit number converts without rounding. Input is limited to a few thousand characters so the page stays quick.
Why does 0.1 in decimal never end in binary?
Some fractions repeat forever in another base, like 1/3 = 0.333... in decimal. 0.1 in decimal is one of them in binary, so the answer is cut after 24 places and marked as cut off.
What do the letters in hexadecimal mean?
Bases above 10 need more digits than 0 to 9, so letters are used: A is 10, B is 11 and so on up to F (15) in hexadecimal, and up to Z (35) in base 36. Upper or lower case both work.