Binary Converter

A binary converter rewrites a number between base 2, base 8, base 10 and base 16. To go from decimal to binary, divide by 2 repeatedly and read the remainders upward: 156 = 10011100. Reversing it, add the place values 128+16+8+4 to get 156 back.

Convert nonnegative whole numbers exactly between decimal, binary, octal and hexadecimal.

Up to 4096 input characters per value; the bit strip stops above 512 bits. Bulk processes only the first 200 nonblank lines and displays a limit notice.

Presets
Invalid input
Bit Visualization

Lines written with only 0 and 1 were read as decimal. Pick Binary above, or prefix them with 0b, to read them as bits.

Copied

Copy failed. Select the result and copy it manually.

Embed this tool on your website

Use whole pixel dimensions from 1 to 4096.

× px (1–4096)

                        

💡 Integration Tip

Copy the embed code and paste it into your website HTML. The responsive version adapts to all screen sizes automatically.

3.7
3 ratings
✓

How do you convert decimal to binary by hand?

Divide the decimal number by 2, write the remainder, then divide the quotient by 2 again and repeat until the quotient reaches 0. Reading the remainders from the bottom up gives the binary string. Here is 156 worked all the way down; the remainder column read upward is 10011100.

Division Quotient Remainder (bit)
156 ÷ 2 78 0
78 ÷ 2 39 0
39 ÷ 2 19 1
19 ÷ 2 9 1
9 ÷ 2 4 1
4 ÷ 2 2 0
2 ÷ 2 1 0
1 ÷ 2 0 1

Read the remainder column from the last row to the first: 1, 0, 0, 1, 1, 1, 0, 0 — so 156 in binary is 10011100.

How do you convert binary to decimal?

Each bit carries a place value that doubles from right to left. Write the weights above the bits and add the weights that sit over a 1. In 10011100 the 1s stand over 128, 16, 8 and 4, and 128 + 16 + 8 + 4 = 156.

Bit position Place value Bit in 10011100 Adds
2⁷ 128 1 128
2⁶ 64 0 0
2⁵ 32 0 0
2⁴ 16 1 16
2³ 8 1 8
2² 4 1 4
2¹ 2 0 0
2⁰ 1 0 0
128 + 16 + 8 + 4 156

Binary, decimal, octal and hexadecimal conversion chart

The first sixteen values are the ones worth memorising, because one hexadecimal digit is exactly four bits. The landmark rows below them are the boundaries you meet in real code: a full byte, a signed byte, two bytes and a kibibyte (1024 bytes).

Decimal Binary Octal Hexadecimal
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
16 10000 20 10
32 100000 40 20
64 1000000 100 40
100 1100100 144 64
127 1111111 177 7F
128 10000000 200 80
255 11111111 377 FF
256 100000000 400 100
1024 10000000000 2000 400
65535 1111111111111111 177777 FFFF

How do you convert binary to hexadecimal and octal?

Group the bits instead of doing arithmetic. For hexadecimal take four bits at a time from the right, padding the left with zeros: 110110111 becomes 0001 1011 0111 = 1B7. For octal take three bits at a time: 110 110 111 = 667. Both equal 439 in decimal, and both conversions run the other way by expanding each digit back into its group of bits.

How does binary convert to text and ASCII?

Characters are stored as numbers, so binary becomes text in two steps: split the stream into 8-bit bytes, then look each byte up in the character table. RFC 20 fixes the classic 7-bit ASCII codes that UTF-8 still reuses for English, so 01001000 01101001 is 72 105, which spells "Hi".

Character ASCII code Binary Hexadecimal
(space) 32 00100000 20
0 48 00110000 30
A 65 01000001 41
H 72 01001000 48
a 97 01100001 61
i 105 01101001 69

How do you write an IP address in binary?

An IPv4 address is four 8-bit octets, so convert each number separately and pad every one to eight bits. 192.168.1.1 becomes 11000000.10101000.00000001.00000001. The padding is what makes prefixes readable: a /24 mask keeps the first 24 bits, which is 255.255.255.0, and a /27 mask ends mid-octet at 224 = 11100000.

How are negative numbers stored in binary?

Almost every processor uses two’s complement: write the positive value, flip every bit, then add 1. For −5 in eight bits, 00000101 flips to 11111010 and becomes 11111011. The leftmost bit acts as the sign, so an 8-bit signed range is −128 to 127 while the same 8 bits unsigned run 0 to 255. This converter works in unsigned whole numbers, so type 251 to see the bit pattern of −5.

Sources

The character codes, binary prefixes and address formats used on this page come from these specifications.

Method and limits

Each field represents the same integer using base 10, 2, 8 or 16. BigInt preserves digits beyond JavaScript’s safe integer range.

Up to 4096 input characters per value; the bit strip stops above 512 bits. Bulk processes only the first 200 nonblank lines and displays a limit notice.

These conversions run in this page.

About Binary Converter

Convert nonnegative whole numbers exactly between decimal, binary, octal and hexadecimal.

255 decimal → 11111111 binary, 377 octal, FF hex. A debugger value can be checked without rounding.

Bulk 0b10 and 0x10 → decimal 2 and 16. Review invalid rows before copying or exporting CSV.

Up to 4096 input characters per value; the bit strip stops above 512 bits. Bulk processes only the first 200 nonblank lines and displays a limit notice.

Use Cases

255 decimal → 11111111 binary, 377 octal, FF hex. A debugger value can be checked without rounding.
Bulk 0b10 and 0x10 → decimal 2 and 16. Review invalid rows before copying or exporting CSV.

How do I use this binary converter step by step?

1

Type digits in any field, or choose a preset. For a list, open bulk conversion and choose the source base.

2

Prefixes 0b, 0o and 0x override the bulk base. Auto reads unprefixed digits as decimal, letters A–F as hex, and warns when a digit string could also be binary.

Pro Tips

  • Up to 4096 input characters per value; the bit strip stops above 512 bits. Bulk processes only the first 200 nonblank lines and displays a limit notice.

Frequently Asked Questions

Without a prefix, auto uses decimal for digits. Choose binary or write 0b1010 to obtain decimal 10.

Yes. Integer digits use BigInt, not floating point. Fractions, negatives, separators and expressions are rejected.

Popular Tools

No more tools to show
Explore All Tools
FreeWebTools AI
Powered by free AI models · Full chat →