Decimal to Binary Converter

Convert decimal to binary

Convert between binary, octal, decimal, hex and any base to 36, with two's complement.

Free, private, no sign-up

Was this tool helpful?

How to use it

Type a whole number in any field: binary, octal, decimal, hex, or a base of your choice from 2 to 36. The other fields update as you type. Spaces and underscores between digits are fine, so you can paste 1111_0000 or FF FF. Each field has a Copy button, which copies the digits without spaces.

How number bases work

In base 10 each place is worth ten times the one to its right: 255 is 2 ร— 100 + 5 ร— 10 + 5. Binary does the same with 2: 11111111 is 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. Hex uses sixteen digits, 0โ€“9 and then Aโ€“F for 10 to 15, so 255 is FF (15 ร— 16 + 15). Bases above 10 keep going through the alphabet, up to Z for 35 in base 36.

DecimalBinaryOctalHex
10101012A
2551111 1111377FF
4,0961 0000 0000 0000100001000
65,5351111 1111 1111 1111177777FFFF

Good to know

Can I paste 0x, 0b or 0o prefixes?

Yes, in their own field: 0x in hex, 0b in binary and 0o in octal. In the hex field, 0b1 is read as the hex digits B and 1 (177), because B is a hex digit.

What is two's complement?

It's how computers store negative whole numbers in a fixed number of bits. Choose 8, 16, 32 or 64 bits: binary, octal and hex then show the stored bit pattern, and decimal shows the signed value. โˆ’1 in 8 bits is 1111 1111 (FF), and typing 0x80 in hex reads as โˆ’128.

How big can the numbers be?

As big as you like, up to 4,096 characters. There's no 64-bit limit unless you choose a width.

Can I convert fractions like 0.1?

No, only whole numbers. Many fractions never end in another base (0.1 in binary repeats forever), so they need rounding rules this tool doesn't guess at.

Is my number sent anywhere?

No. Everything is worked out in your browser.