Developer
Encoders, converters & dev utilities
Number-Base Converter
Convert between binary, octal, decimal, hex & any base 2–36 — with steps & two's complement. Accurate, instant and free — for United States.
100% in-browser — nothing is uploaded
Binary, grouped
0010 1010
Binary → decimal (positional expansion)
1·2⁵ + 1·2³ + 1·2¹
= 32 + 8 + 2 = 42
Decimal → binary (remainder ladder)
Divide by 2 repeatedly; read remainders bottom-up.
| ÷ 2 | Quotient | Remainder |
|---|---|---|
| 42 | 21 | 0 |
| 21 | 10 | 1 |
| 10 | 5 | 0 |
| 5 | 2 | 1 |
| 2 | 1 | 0 |
| 1 | 0 | 1 |
Bottom-up → 101010
Why hex and octal?
Converting the charactersof a string to bits instead of a numeric value? That's character encoding, not base conversion — use the Text ↔ Binary Converter. For byte-level encoding reach for the Base64 Converter.
Every base is digits times powers
A number written in base b is a sum of its digits multiplied by ascending powers of b. The only thing that changes between bases is how many distinct digits you have and what each place is worth. Type a value into any field above and the others update instantly — with the full working shown below the fields.
To decimal
Positional expansion
1010₂ = 1·2³ + 1·2¹ = 10
- Each place is a power of the base
- Multiply digit × place, then sum
- Works for any base 2–36
From decimal
Remainder ladder
10 ÷ 2 → read remainders up → 1010
- Divide repeatedly by the base
- Collect each remainder
- Read bottom-to-top for the digits
Two's complement — how bits become negative
Computers store signed integers in a fixed width using two's complement. The most-significant bit carries the sign: set it, and the value wraps into the negative range. Pick a bit width and toggle the signed checkbox to watch the same bit pattern read as two different numbers.
Reading signed
value − 2^width
- 11111111 = 255 unsigned
- Sign bit set → 255 − 256
- = −1 in 8-bit signed
Encoding negative
2^width + value
- −1 → 256 + (−1)
- = 255
- = 11111111
Width matters
Why hex and octal exist
Hex and octal are compact, exactshorthands for binary. One hex digit is exactly 4 bits and one octal digit exactly 3 bits, so long binary strings collapse into a few readable characters with no rounding. That's why byte values, memory addresses and colors are written in hex: 0xff beats 11111111. Bases above 10 borrow letters — a=10 through z=35 — up to base 36.
Frequently asked questions
A number in any base is a sum of digits times powers of that base. In binary (base 2), 1010 means 1·2³ + 0·2² + 1·2¹ + 0·2⁰ = 8 + 0 + 2 + 0 = 10 in decimal. To go the other way — decimal to another base — you divide repeatedly by the base and read the remainders bottom-to-top: 10 ÷ 2 = 5 r0, 5 ÷ 2 = 2 r1, 2 ÷ 2 = 1 r0, 1 ÷ 2 = 0 r1 → reading up gives 1010. This tool shows both the positional expansion and the remainder ladder for the value you enter.
Two's complement is how computers store negative integers in a fixed number of bits. In an 8-bit byte the leftmost bit (the most-significant bit) is the sign: if it's 1 the number is negative. To read a signed pattern, take its unsigned value and subtract 2^width if the sign bit is set. So 11111111 in 8-bit is 255 unsigned, but 255 − 256 = −1 signed. To encode a negative value, add it to 2^width: −1 → 256 + (−1) = 255 = 11111111. Toggle the signed checkbox and pick a bit width (4/8/16/32/64) to see both interpretations of the same bits.
Because they map cleanly onto binary. One hex digit represents exactly 4 bits and one octal digit exactly 3 bits, so long binary strings collapse into short, readable groups without any lossy rounding. The byte 11111111 is just 0xff in hex; a 32-bit color or memory address is far easier to read and type in hex than as 32 ones and zeros. Decimal, by contrast, does not line up on bit boundaries, which is why low-level code leans on hex and octal.
Yes. The converter uses JavaScript BigInt for all arithmetic, so there is no floating-point precision limit — a full 64-bit value like 18446744073709551615 (0xffffffffffffffff) converts exactly across every base. This matters because ordinary numeric conversion in many tools silently loses precision above 2^53; here every digit is exact.
Any base from 2 to 36. Binary, octal, decimal and hex each have their own always-visible field, and the "Any base" selector covers everything in between — base 3, base 12, base 32, up to base 36. Bases above 10 use letters a–z as the extra digits (a = 10, b = 11, … z = 35), the same convention as hexadecimal. Input is case-insensitive.
Method, standards & references
Method: values are parsed and formatted with exact BigInt arithmetic (accumulate digit × base). Signed interpretation subtracts 2^width when the sign bit is set; two's-complement encoding adds 2^width to a negative value and left-pads to the chosen width. Everything runs in your browser — nothing is uploaded.
How we calculate this
Reviewed by Reckonist Editorial · Last reviewed 4 July 2026. Figures follow the methods and sources set out in our editorial standards.
This tool converts integers between bases 2–36 and interprets fixed-width signed (two's-complement) values, entirely in your browser using exact BigInt arithmetic. It handles whole numbers; fractional and floating-point bases are out of scope.
Keep going
Same-category tools follow this colour; a cross-category link keeps its own.