Binary, Decimal, Hex & Octal Converter

Type a number into any field (binary, decimal, hexadecimal, or octal) and all other bases update instantly. No button to press, no page reload. Supports arbitrarily large integers with no rounding.

How do I use this converter?
Enter a number in any of the four fields (binary, decimal, octal, or hexadecimal) and the other three fields fill in automatically. Each field validates its own base: the binary field only accepts 0 and 1, the octal field accepts 0–7, the hex field accepts 0–9 and A–F (case-insensitive), and the decimal field accepts standard digits. You can start editing from any field at any time.
How to convert binary to decimal?

Binary is a positional number system, meaning the value of each digit depends on its position. In decimal you are used to positions representing ones, tens, hundreds (powers of 10). In binary, positions represent powers of 2: 1, 2, 4, 8, 16, 32 … reading right to left.

Step-by-step method: write out the binary number, label each bit with its positional power of 2 from right to left starting at 2⁰, then multiply each bit (0 or 1) by its power and add up the results.

Example: convert 1101 to decimal

BitPositionPowerValue
131 × 8 = 8
121 × 4 = 4
010 × 2 = 0
102⁰1 × 1 = 1

Sum: 8 + 4 + 0 + 1 = 13. So 1101 binary = 13 decimal.

Another example: 11111111 (8 bits all set to 1) 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. This is the maximum value of an unsigned byte.

Shortcut for all-ones patterns: a binary number made of n consecutive 1-bits always equals 2ⁿ − 1. Eight 1s → 2⁸ − 1 = 255. Sixteen 1s → 2¹⁶ − 1 = 65 535.

How to convert decimal to hexadecimal?

The standard method is repeated division by 16. Divide the number by 16, record the remainder, then divide the quotient again, repeating until the quotient reaches 0. Remainders of 10–15 are written as A–F. Read the remainders from bottom to top to get the hex value.

Example: convert 764 decimal to hex

StepDivisionQuotientRemainderHex digit
1764 ÷ 164712C
247 ÷ 16215F
32 ÷ 160 ← stop22

Reading the hex digits bottom-up (step 3 → 1): 2FC. Verify: 2 × 16² + 15 × 16 + 12 = 512 + 240 + 12 = 764

Shortcut for powers of 2: since 256 = 16², any decimal value under 256 fits in exactly two hex digits. 0 → 00, 255 → FF. This is why a single byte is always two hex characters, useful to remember when reading memory dumps or colour codes.

How to convert hexadecimal to binary?

Because 16 = 2⁴, each hex digit expands to exactly 4 binary bits (a nibble), no arithmetic required. Simply replace every hex digit with its 4-bit equivalent from the table below, preserving order.

Example: convert 3E8 hex to binary

Hex digitDecimal4-bit binary
330011
E141110
881000

Concatenate the groups: 0011 1110 1000. So 3E8 hex = 001111101000 binary = 1000 decimal.

Going the other way (binary → hex) is equally mechanical: group the bits into chunks of 4 from the right, padding with leading zeros if needed, then replace each group with its hex digit. For example, 10110111 1011 0111 → B 7 → B7 = 183 decimal.

Why this matters: a 32-bit IPv4 address, a 24-bit RGB colour, a 64-bit pointer: all are commonly written in hex because the nibble boundary makes it trivial to inspect individual bits without any calculation.

What is binary (base 2) and where is it used?
Binary is a positional numeral system that uses only two digits: 0 and 1. Every digital computer stores data and executes instructions in binary at the hardware level, because electronic circuits naturally represent two states: off (0) and on (1). Common uses include defining CPU registers (8-bit, 16-bit, 32-bit, 64-bit), network subnet masks (e.g. 11111111.00000000), and bitwise flags in software. For example, 255 in binary is 11111111, the maximum value of an unsigned 8-bit byte.
What is hexadecimal (base 16) and where is it used?

Hexadecimal uses 16 symbols: digits 0–9 plus letters A–F, where A = 10, B = 11 … F = 15. Because 16 = 2⁴, every single hex digit maps to exactly 4 binary bits (a nibble). This makes hex a lossless, compact shorthand for binary: two hex digits represent one full byte.

Complete hex ↔ decimal ↔ binary reference:

HexDecimalBinaryHexDecimalBinary
000000881000
110001991001
220010A101010
330011B111011
440100C121100
550101D131101
660110E141110
770111F151111

Example: convert AB hex to binary and decimal A = 1010, B = 1011, so AB hex = 10101011 binary. In decimal: 10 × 16 + 11 = 171.

How to convert decimal to hex: repeatedly divide by 16 and note the remainder. For 255: 255 ÷ 16 = 15 remainder 15 (F); 15 ÷ 16 = 0 remainder 15 (F). Reading remainders bottom-up: FF.

Where hex is used: memory addresses (0x7FFFFFFF), CSS colors (#1A2B3C = R:26 G:43 B:60), SHA-256 hashes (64 hex chars = 256 bits), UTF-8 escape sequences (\xFF), and binary file viewers (hex dumps).

What is octal (base 8) and where is it used?

Octal uses eight digits: 0–7. Because 8 = 2³, each octal digit maps to exactly 3 binary bits. This makes octal a compact grouping of binary, similar to hex but less common in modern systems.

Octal ↔ binary mapping:

OctalBinaryDecimal
00000
10011
20102
30113
41004
51015
61106
71117

How to convert decimal to octal: divide repeatedly by 8 and collect remainders. For 255: 255 ÷ 8 = 31 r7; 31 ÷ 8 = 3 r7; 3 ÷ 8 = 0 r3. Reading bottom-up: 377.

Is there a maximum number size?
No. The converter uses JavaScript BigInt internally, which supports integers of arbitrary size. You can enter numbers with hundreds of digits without any overflow or loss of precision.