Binary Converter
Binary 101010 = 42 in decimal, 2A in hex and 52 in octal. Type a whole number in binary, decimal, hexadecimal or octal and see all four bases at once, converted exactly in your browser.
Bit length and byte grouping
6 bits in the minimal unsigned representation; 1 byte needed.
Bytes (left padded with zeros): 00101010
Unsigned integers only. Spaces are treated as digit grouping; this does not decode text, fractions or two’s complement.
10101052422AExact unsigned integer conversion
- Convert binary, octal, decimal and hexadecimal integers without floating-point integer rounding.
- See the minimal bit length and an eight-bit byte grouping padded on the left.
How to use the Binary Converter
- Choose whether the entered value is binary, octal, decimal or hexadecimal.
- Enter a valid whole-number value for that base.
- Binary accepts digits 0 and 1, octal accepts 0 through 7, decimal accepts 0 through 9 and hexadecimal accepts 0 through 9 plus A through F.
- Common 0b and 0x prefixes are accepted.
- The converter parses the integer using exact BigInt arithmetic.
- The same integer is then displayed in binary, octal, decimal and hexadecimal notation.
- Use the Copy button beside any result to copy that representation.
Integer representation limits
Prefixes 0b, 0o and 0x are accepted with the matching selected input base. Spaces are removed as grouping separators. Leading zeros are not preserved in the minimal representation.
Byte padding changes the display, not the value. This tool does not infer signed two’s complement, decode text or accept fractional or negative values.
Examples
A byte boundary
Decimal 256 = binary 100000000 = hex 100. It needs 9 significant bits, displayed as bytes 00000001 00000000.
Beyond safe floating-point integers
Decimal 9007199254740993 remains exact because conversion uses BigInt rather than JavaScript Number.
Binary, hex and octal chart (0–16)
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 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 | 8 | 10 |
| 9 | 1001 | 9 | 11 |
| 10 | 1010 | A | 12 |
| 11 | 1011 | B | 13 |
| 12 | 1100 | C | 14 |
| 13 | 1101 | D | 15 |
| 14 | 1110 | E | 16 |
| 15 | 1111 | F | 17 |
| 16 | 10000 | 10 | 20 |
Powers of 2
Each extra binary digit doubles the range. These values come up constantly in computing.
| Power | Decimal value | Binary |
|---|---|---|
| 2^0 | 1 | 1 |
| 2^1 | 2 | 10 |
| 2^2 | 4 | 100 |
| 2^3 | 8 | 1000 |
| 2^4 | 16 | 10000 |
| 2^5 | 32 | 100000 |
| 2^6 | 64 | 1000000 |
| 2^7 | 128 | 10000000 |
| 2^8 | 256 | 100000000 |
| 2^10 | 1,024 | 10000000000 |
| 2^16 | 65,536 | 10000000000000000 |
| 2^32 | 4,294,967,296 | 1 followed by 32 zeros |
Frequently asked questions
How do I convert binary to decimal?
Write the place values 1, 2, 4, 8, 16 and so on under the digits, starting from the right. Add the place values where the digit is 1. For 1011: 8 + 2 + 1 = 11.
How do I convert decimal to binary?
Divide the number by 2, write down the remainder, and repeat with the quotient until you reach 0. The binary number is the remainders read from last to first. 13 gives 1101.
What is 255 in binary?
255 is 11111111 in binary (eight 1s), FF in hex and 377 in octal.
How do I convert binary to hexadecimal?
Split the binary number into groups of 4 digits from the right, then replace each group with one hex digit (0000 = 0 … 1001 = 9, 1010 = A … 1111 = F). 101010 → 0010 1010 → 2A.
What is a bit and a byte?
A bit is one binary digit (0 or 1). A byte is 8 bits, so it can represent 2^8 = 256 different values, from 0 to 255.
Does the converter work with very large numbers?
Yes. It uses exact whole-number arithmetic, so long binary or hex values convert without the rounding errors normal calculators can introduce.
Can I type 0b or 0x prefixes?
Choose the matching input base first: binary accepts 0b, octal accepts 0o and hexadecimal accepts 0x. Decimal accepts digits only. The selected base determines the interpretation.
More converters tools
Roman Numeral Converter
Convert numbers to Roman numerals and Roman numerals back to numbers.
Open tool →Hex Converter
Convert hexadecimal, decimal, binary and octal integers instantly.
Open tool →Unit Converter
Convert length, weight, temperature, area, volume, speed and common metric and imperial units.
Open tool →MP4 to MP3 Converter
Convert a local MP4 video file to MP3 directly in your browser.
Open tool →Number to Words Converter
Convert whole numbers into written English words.
Open tool →Inches to CM Converter
Convert inches to centimeters instantly.
Open tool →