Skip to content

Binary to Decimal Converter

Convert binary to decimal, decimal to binary, and to or from hex and octal. Type a number once and see it in all four bases at the same time, with fractions and very long numbers supported.

Convert a number

Ready

Input Number

Type a number in the source base. Spaces and underscores between digits are ignored.

Numeric Mode Awaiting input
Source value Example: 255, 1111 1111, 0xFF, -1010.101
Reads 0b for binary, 0o for octal, and 0x for hexadecimal from the pasted input.
Adds 0b, 0o, or 0x when the destination base is 2, 8, or 16.
Useful for hex and other custom bases above 10.
When output base is binary, pads integer results to 8-bit groups for easier reading.

Converted Output

The result in the target base, with binary, octal, decimal and hex below.

Converted Number

1111 1111

Decimal 255 equals binary 11111111.
Binary
1111 1111
Octal
377
Decimal
255
Hexadecimal
FF

Text ⇄ Number Utilities

Turn text into UTF-8 bytes in the target base, or read the current number's bytes as text.

Text input UTF-8 bytes
Decoded text Integer bytes
Encoded byte sequence
54 6F 6F 6C 7A 79 4C 61 62

Analysis

Detailed info about the parsed number.

Number Type
Integer
Sign
Positive
Integer Digits
3
Fraction Digits
0
Bit Length
8
Approx Decimal
255

Integer Byte View

Useful for low-level debugging and byte order inspection.

Big-endian bytes
FF
Little-endian bytes
FF

Quick Examples

Tap any example to load it instantly.

Tips

Any base from 2 to 36 works, using A-Z as digits above 9.
Fractions like 101.101 work too. Fraction Precision sets how many digits follow the point.
Paste 1111 0000 or 1111_0000: spaces and underscores are ignored.
Set Signed binary to a bit width to read 11111011 as -5 (8-bit) or show -5 as 11111011.
With auto-detect on, 0xFF, 0o17 and 0b1010 set the source base for you.

Runs in your browser. Nothing you type, paste or open here is uploaded.

To convert binary to decimal, set From Base to Base 2 - Binary and To Base to Base 10 - Decimal, or select Swap Bases from the default decimal-to-binary setup. Then type the binary number. You can also paste it with a 0b prefix. The result updates as you type, and the Decimal box always shows the base 10 value.

How to convert binary to decimal

  1. Set the bases. The converter opens on decimal to binary. Select Swap Bases to reverse the direction, or pick any pair from From Base and To Base.
  2. Enter the number. Type or paste it in Source value. Spaces and underscores between digits are ignored, so 1111 0000 and 1111_0000 both work. With Auto-detect prefixes on, 0b1010, 0o17 and 0xFF switch the source base for you.
  3. Read the result. Converted Output shows the answer, and the four boxes below show binary, octal, decimal and hexadecimal together. Analysis adds the bit length and sign.
  4. Copy it. Copy Result copies the main answer. Copy All copies the input and all four bases as text.

Binary place values: converting by hand

Each binary digit (bit) stands for a power of 2, starting with 1 on the right and doubling as you move left: 1, 2, 4, 8, 16, 32 and so on. Add up the values where the bit is 1.

Example: 101101

Place value32168421
Bit101101

32 + 8 + 4 + 1 = 45. So binary 101101 is decimal 45.

Fractions work the same way to the right of the point, with place values of 1/2, 1/4, 1/8 and so on. Binary 1010.101 is 8 + 2 + 0.5 + 0.125 = 10.625.

Decimal to binary: the divide-by-2 method

Divide the number by 2 again and again, writing down each remainder, until you reach 0. Then read the remainders from the last one to the first.

Example: 156 ÷ 2 = 78 r0, 78 ÷ 2 = 39 r0, 39 ÷ 2 = 19 r1, 19 ÷ 2 = 9 r1, 9 ÷ 2 = 4 r1, 4 ÷ 2 = 2 r0, 2 ÷ 2 = 1 r0, 1 ÷ 2 = 0 r1. Reading upwards gives 10011100. Check it: 128 + 16 + 8 + 4 = 156.

The converter does this instantly. With Pad binary to full bytes on, results are padded with leading zeros to a multiple of 8 bits, and Digit Grouping splits them into blocks of 4 (the default) or 8 so long numbers are easier to read.

Decimal to hex and hex to decimal

Hexadecimal is base 16. It uses 0-9 and then A-F for 10 to 15. Each place is worth 16 times the one to its right: 1, 16, 256, 4,096.

  • Hex to decimal: 2AF = 2 × 256 + 10 × 16 + 15 × 1 = 512 + 160 + 15 = 687.
  • Decimal to hex: divide by 16 and keep the remainders. 500 ÷ 16 = 31 r4, 31 ÷ 16 = 1 r15 (F), 1 ÷ 16 = 0 r1. Reading upwards gives 1F4.
  • Hex to binary: each hex digit is exactly 4 bits, so FF is 1111 1111 and 1F4 is 0001 1111 0100.

Octal (base 8) groups bits in threes instead: decimal 64 is 100 in octal. Programmers see hex in color codes; the RGB to HEX converter handles those directly.

Signed binary to decimal (two's complement)

Computers usually store negative whole numbers in two's complement. In an 8-bit value, the leftmost bit is the sign: if it's 1, the number is negative.

To read 11111011 as a signed 8-bit number, invert every bit to get 00000100, add 1 to get 00000101, which is 5, and put a minus sign in front: -5. A shortcut: read it as unsigned (251) and subtract 256.

By default the converter reads numbers as written, so 11111011 converts to 251, and a minus sign makes a value negative (-1010 gives -10). Set Signed binary to Two's complement, 8-bit and the same 11111011 gives -5. It works the other way too: enter -5 in decimal with binary as the target and you get 11111011. Widths of 8, 16, 32, 64 and 128 bits are available, and a value that doesn't fit the chosen width shows a message instead of a wrong answer.

Number base converter for bases 2 to 36 and text

Both base lists run from 2 to 36, using the letters A-Z as digits above 9, so you can convert to base 36 or base 5 as easily as to hex. Whole numbers are calculated with JavaScript BigInt, so even very long values stay exact. Fraction Precision sets how many digits appear after the point (8 by default) when a fraction doesn't end.

The Text ⇄ Number Utilities panel turns text into its UTF-8 bytes in the output base, for example "Hi" in hex is 48 69. To turn readable text into binary and back, the binary translator is quicker.

Frequently asked questions

How do you read a binary number in decimal?

Multiply each bit by its place value (1, 2, 4, 8, 16 and so on from the right) and add the results. Binary 1101 is 8 + 4 + 0 + 1 = 13.

How do you convert decimal to binary?

Divide the number by 2 repeatedly and note each remainder, then read the remainders from bottom to top. Decimal 13 gives remainders 1, 0, 1, 1, so it's 1101 in binary.

What is 255 in binary and hex?

255 is 11111111 in binary and FF in hexadecimal. It's the largest number one byte (8 bits) can hold.

Does the converter handle negative numbers?

Yes, with a minus sign: -255 converts to -FF in hex. For signed fixed-width values, set Signed binary to a two's complement width such as 8-bit; then 11111011 reads as -5 and -5 is shown as 11111011.

Can I convert binary fractions?

Yes. Enter a value with a point, such as 1010.101, and it converts to 10.625. Choose up to 24 digits in Fraction Precision for fractions that repeat.

Is there a limit on how long the number can be?

Whole numbers have no fixed limit, because the converter uses exact big-integer maths in your browser. Very long inputs only depend on your device's memory and speed.

Updated 11 October 2026Reviewed by the ToolzyLab teamHow we test our tools