Free online converter

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.

Binary101010
Octal52
Decimal42
Hexadecimal2A

Exact 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

  1. Choose whether the entered value is binary, octal, decimal or hexadecimal.
  2. Enter a valid whole-number value for that base.
  3. 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.
  4. Common 0b and 0x prefixes are accepted.
  5. The converter parses the integer using exact BigInt arithmetic.
  6. The same integer is then displayed in binary, octal, decimal and hexadecimal notation.
  7. 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)

DecimalBinaryHexOctal
0000
1111
21022
31133
410044
510155
611066
711177
81000810
91001911
101010A12
111011B13
121100C14
131101D15
141110E16
151111F17
16100001020

Powers of 2

Each extra binary digit doubles the range. These values come up constantly in computing.

PowerDecimal valueBinary
2^011
2^1210
2^24100
2^381000
2^41610000
2^532100000
2^6641000000
2^712810000000
2^8256100000000
2^101,02410000000000
2^1665,53610000000000000000
2^324,294,967,2961 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.

Related tools

More converters tools