Dev Toolbox · Windows 10 and 11
Convert binary, decimal, hex and octal
Four boxes, one number. Type into Binary, Octal, Decimal or Hexadecimal and the other three follow as you type. It handles numbers of any length exactly, from a single byte to a 256-bit key, and it understands the 0x, 0b and 0o prefixes that come with code.
How to convert binary to decimal
- 1
Open the Number base converter
In the Dev Toolbox, choose Number base converter in the Check group. It starts with 255 shown in all four bases.
- 2
Type your number
Type or paste into the box of the base you have: Binary, Octal, Decimal or Hexadecimal. A prefix like 0x, and spaces or underscores between groups of digits, are fine.
- 3
Read the others
The other three boxes change with every keystroke. Hex is shown in capitals.
- 4
Copy the one you need
Select the value in its box and press Ctrl C. Typing a digit that does not belong to the base brings up a short warning, and the number stays as it was.
How positional number systems work
Every base works the same way: each position is worth the base times the position to its right. In decimal those are ones, tens and hundreds. In binary they are 1, 2, 4, 8, 16 and so on, doubling each step.
So binary 1011 is 8 + 0 + 2 + 1 = 11 in decimal. To go the other way by hand, divide by 2 again and again and read the remainders from the bottom up: 11 gives the remainders 1, 1, 0 and 1, which read backward spell 1011.
Hexadecimal needs sixteen digits, so after 0 to 9 come A to F for ten to fifteen: hex 2F is 2 × 16 + 15 = 47. Octal uses only 0 to 7, each place worth eight times the one to its right.
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
| 1024 | 10000000000 | 2000 | 400 |
Why programmers use hex and octal
Hex and octal are shorthand for binary. One hex digit is exactly four bits, so a byte is always two hex digits, 00 to FF, and a 32-bit value is eight. That is why memory addresses, color codes, MAC addresses, hashes and error codes are written in hex: the Windows error 0x80070005 (access denied) is far easier to read and compare than its 32 binary digits.
One octal digit is exactly three bits, which is why Unix file permissions use it. chmod 755 is 111 101 101 in binary: read, write and execute for the owner (7), read and execute for everyone else (5 and 5).
Colors are a common case: in #FF8000, the pairs FF, 80 and 00 are red 255, green 128 and blue 0, and the color converter splits them for you. Sizes are another: 0x400 is 1024, the step between units when Windows counts kilobytes and megabytes, which the data size converter handles.
Exact at any size, and what it does not do
Many converters, and JavaScript's ordinary numbers, start rounding past 2 to the power of 53, about 9 quadrillion. This one works with whole numbers of any length, exactly. The largest 64-bit unsigned value, 0xFFFFFFFFFFFFFFFF, comes out as 18446744073709551615, and a 256-bit hash pasted into the Hexadecimal box turns into an exact decimal of up to 78 digits.
- No negative numbers. To see the bit pattern a computer stores for a negative value (two's complement), add 2 to the power of the bit width first. For -1 in 32 bits, enter 4294967295, which shows as FFFFFFFF; for -5, enter 4294967291 and you get FFFFFFFB.
- No fractions. Only whole numbers; a decimal point or comma is not a digit.
- Numbers, not text. It converts the value 65, not the letter A. Turning words into binary character codes is a different job.
Programmer mode, PowerShell and this converter
Windows Calculator has a Programmer mode that shows HEX, DEC, OCT and BIN together and adds bitwise operations such as AND, OR and shifts. It works with signed values up to 64 bits (QWORD), so it shows two's complement directly. In PowerShell, [Convert]::ToString(255, 2) gives the binary, and typing 0xFF at the prompt gives 255. And for hex to binary in your head, translate one digit at a time into four bits: F is 1111 and 8 is 1000, so 0xF8 is 11111000.
Octoolo's converter is for the moments in between: a hex value from a log, a binary flag field from a data sheet, an ID too large for 64 bits. All four bases stay in view at once, with no mode to switch into and no word size to pick. Other conversions sit in the Calculator: Roman numerals, data sizes and units.
Questions, answered
How do I convert binary to decimal by hand?
Write the place values over the digits from the right, 1, 2, 4, 8, 16 and so on, and add up those that sit over a 1. For 110010 that is 32 + 16 + 2 = 50.
How do I convert hex to decimal?
Multiply each digit by 16 to the power of its position, counting from 0 on the right, with A to F standing for 10 to 15. 1A3 is 1 × 256 + 10 × 16 + 3 = 419. Or type it into the Hexadecimal box.
Does it accept lowercase hex and prefixes?
Yes. a to f work like A to F. A 0x, 0b or 0o at the start is skipped, and so are spaces and underscores between groups of digits, so 0xDEAD_BEEF works.
Why does hex use letters?
Base 16 needs sixteen single-character digits and 0 to 9 gives only ten, so A to F stand for 10 to 15. Upper or lower case means the same.
Is there a size limit?
No practical one. Numbers are kept as exact whole numbers however long they get, so a 128-bit UUID without its hyphens, or a 256-bit hash, converts without rounding.
Number base converter, and 16 more apps.
Download for Windows7 days free, then from $3.99 a month for all 17 apps. Windows 10 and 11.