Binary Converter: Binary, Decimal, Hex, Octal, and Text
Last updated: November 14, 2026 · By the Real Percentage Calculator Team
Direct answer. To convert binary to decimal, multiply each digit by 2 raised to its position (counting from 0 on the right) and add the results. 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 11. In hexadecimal that is B, and in octal it is 13.
Convert whole numbers between base 2, base 8, base 10, and base 16, see a signed number as an 8-, 16-, 32-, or 64-bit two’s complement pattern, or turn text into UTF-8 binary and back. Large values stay exact, and everything runs in your browser.
Binary Converter
Convert whole numbers between binary, octal, decimal, and hexadecimal, see a two’s complement bit pattern, or turn text into UTF-8 binary and back. Everything runs in your browser.
Result
Key takeaways
- Value = Σ digit × base^position.
- Each hex digit is exactly 4 binary digits; each octal digit is 3.
- Two’s complement stores −n as 2^bits − n.
- Text conversion uses UTF-8, so some characters take more than one byte.
How to use this calculator
- Choose a conversion: number between bases, two’s complement, text to binary, or binary to text.
- Enter the value. Prefixes 0b, 0o, and 0x are accepted for numbers.
- Choose the input base or bit width if asked.
- Read every representation at once, with place-value steps for short inputs.
The formula
Positional number systems give each digit a weight that is a power of the base. Converting means re-expressing the same value with different weights.
Worked examples
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 11 | 1011 | 13 | B |
| 255 | 11111111 | 377 | FF |
| 1,024 | 10000000000 | 2000 | 400 |
| −5 (8-bit two’s complement) | 11111011 | — | FB |
| “Hi” (UTF-8) | 01001000 01101001 | — | 48 69 |
1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11.
255 = 15 × 16 + 15, and 15 is F in hex, so 255 is FF. In binary it is eight ones: 11111111.
2⁸ − 5 = 251, which is 11111011 in binary. The leading 1 marks it as negative in two’s complement.
When this is useful in the United States
Computer science and IT students check homework on number bases and two’s complement.
Programmers read hex color codes, memory addresses, permissions, and bit flags.
Network learners work with binary subnet masks and IP address octets.
Curious readers see how text is stored as bytes, including emoji and accented letters.
Why programmers use hex
Hexadecimal is popular in programming because each hex digit stands for exactly four binary digits, so long binary strings become short and readable. The byte 11111111 is FF in hex, and a 32-bit value fits in eight hex digits. Web colors use the same idea: #FF8800 is three bytes for red, green, and blue.
Octal groups binary digits in threes, which is why it appears in Unix file permissions such as 755: each digit encodes read, write, and execute bits for one class of user. Converting 7 to binary gives 111, meaning all three permissions are on.
Common mistakes
- Reading binary positions from the left instead of the right.
- Typing letters that are not valid in the chosen base, such as 2 in binary or G in hex.
- Forgetting that two’s complement needs a fixed width; −5 looks different in 8 and 16 bits.
- Assuming one character is always one byte. In UTF-8, é is two bytes and many emoji are four.
This converter works with whole numbers only; it does not convert fractions or floating-point formats. Values up to 256 digits stay exact because the math uses arbitrary-precision integers rather than ordinary floating-point numbers. For two’s complement, the calculator checks that the value fits the chosen width and shows the allowed range if it does not. Text is encoded as UTF-8, the encoding used by most of the web, so the output matches what a browser or programming language would produce for the same string. Nothing you type is sent to a server.
Frequently asked questions
How do I convert binary to decimal?
Multiply each digit by 2 to the power of its position, starting at 0 on the right, and add them up.
How do I convert decimal to binary?
Divide by 2 repeatedly and write the remainders from last to first. The converter does this instantly.
What is two’s complement?
A way to store negative integers in binary. In k bits, −n is stored as 2ᵏ − n.
Why does some text take more than 8 bits per character?
UTF-8 uses one byte for basic English letters and two to four bytes for other characters.
Why does 0.1 not convert to binary here?
This converter handles whole numbers only. Fractions such as 0.1 have no exact binary form, which is why floating-point math can show tiny rounding errors.
How many bits are in a byte?
Eight. One byte can represent 256 values, from 0 to 255 unsigned, or −128 to 127 as a signed two’s complement number.
