Bits
Show steps
Paste binary in 8-bit groups and it decodes as UTF-8 text: 01001000 01100101 01101100 01101100 01101111 reads Hello. Hex (48 65 6C 6C 6F), decimal (72 101 108 108 111) and octal byte codes work too, with or without spaces.
How to use
- Type in any field – binary, octal, decimal, hex or a custom base from 2 to 36 – and every other field updates as you type.
- Tap the copy button next to a field to copy that value. Prefixes like 0x, 0b and 0o, spaces and underscores are accepted.
- In Bits, pick 8, 16, 32 or 64 bits to see the two's complement form, signed and unsigned values. Tap any bit to flip it.
- Open Show steps for the working, or switch to Text to turn text into binary or hex codes and back.
- Numbers of any size are exact – there's no 2⁵³ limit, so you can convert 100-digit values.
- Fractions are supported (use a dot): 0.1 in decimal is 0.0001100110011… in binary. Long or repeating fractions are cut at 64 digits.
- Negative numbers are shown with a minus sign in the fields and as two's complement in the bit view.
- Text mode uses UTF-8, so accents, Cyrillic, Japanese and emoji become 2–4 bytes each.
How positional bases work
In base b, each digit is multiplied by a power of b. Decimal 2024 is 2×10³ + 0×10² + 2×10¹ + 4×10⁰; binary 1011 is 1×8 + 0×4 + 1×2 + 1×1 = 11. Bases above 10 borrow letters, so hexadecimal uses 0–9 and A–F, with A = 10 and F = 15.
To convert a decimal number into base b, divide by b repeatedly and read the remainders from last to first. To convert back, multiply each digit by its place value and add.
Why programmers use hex and octal
One hex digit is exactly four bits and one octal digit three bits, so long binary values shrink without any arithmetic: 1101 1110 1010 1101 is DEAD in hex. You meet hex in color codes (#FF8800), memory addresses and byte dumps, and octal in Unix file permissions such as 755.
Two's complement and limits
Computers store negative integers in two's complement: invert the bits of the positive value and add one, so −42 in 8 bits is 11010110 (0xD6). An 8-bit signed value ranges from −128 to 127, a 16-bit one from −32,768 to 32,767. The converter uses arbitrary-precision integers, so it has no 2⁵³ limit like a plain JavaScript number.
Frequently asked questions
How do I convert binary to decimal?
Multiply each bit by its power of two and add them: 101101 = 32 + 8 + 4 + 1 = 45. The converter shows these place values in the steps.
How do I convert decimal to binary?
Divide by 2 repeatedly and write down the remainders, then read them from the bottom up: 13 → 6 r1 → 3 r0 → 1 r1 → 0 r1, so 13 = 1101.
What is FF in decimal?
FF in hexadecimal is 15 × 16 + 15 = 255, the largest value of one byte.
What does 0x mean in front of a number?
0x marks a hexadecimal literal in C, JavaScript, Python and many other languages, so 0x1F is 31. Similarly, 0b marks binary and 0o octal; the converter accepts all three prefixes.
How is a negative number written in binary?
Usually in two's complement: take the positive value in the chosen bit width, invert every bit and add 1. In 8 bits, −1 is 11111111 and −128 is 10000000.
Can it convert decimal fractions?
Yes. 0.5 is 0.1 in binary and 0.625 is 0.101, but 0.1 never ends in binary (0.000110011…), so long or repeating fractions are cut at 64 digits.