Number Base Converter (Binary, Octal, Decimal, Hex)
Type a whole number in binary, octal, decimal or hexadecimal and see it in the other three. Choose a width (8, 16, 32 or 64 bits) to see its two's complement bit pattern and its signed and unsigned values.
- Binary (base 2)
- –
- Octal (base 8)
- –
- Decimal (base 10)
- –
- Hexadecimal (base 16)
- –
- Bits needed (without sign)
- –
- Bit pattern read as signed (two's complement)
- –
- Bit pattern read as unsigned
- –
Assumptions
- Whole numbers only; fractions are not converted.
- Two's complement: the highest bit of the chosen width weighs −2^(width − 1).
- With a width chosen, the binary, octal and hexadecimal results show the bit pattern, not a minus sign.
Checked 3 November 2026 Princeton University, COS 217 (Spring 2024), Number Systems and Number Representation: positional notation, base conversion, hexadecimal and two's complement All sources
How it is calculated
- Value = Σ digitₖ × baseᵏ (positional notation; k counts from 0 at the right)
- To base b: divide by b repeatedly; the remainders, read from last to first, are the digits
- Hexadecimal digit = 4 bits; octal digit = 3 bits
- Two's complement in n bits: pattern of −x = (NOT x) + 1 = 2ⁿ − x; signed range −2ⁿ⁻¹ to 2ⁿ⁻¹ − 1
Worked example: minus 5 in 8 bits
Minus 5 as an 8-bit two's complement pattern.
| You enter | |
|---|---|
| Number | -5 |
| Written in | Decimal (base 10) |
| Two's complement width | 8 bits |
| You get | |
| Binary (base 2) | 11111011 |
| Octal (base 8) | 373 |
| Decimal (base 10) | -5 |
| Hexadecimal (base 16) | FB |
| Bits needed (without sign) | 3 |
| Bit pattern read as signed (two's complement) | -5 |
| Bit pattern read as unsigned | 251 |
In 8 bits the pattern FB (hexadecimal) reads as -5 when signed (two's complement) and 251 when unsigned.
Questions
Why does FF read as −1 in 8 bits?
In two's complement the top bit of 8 bits weighs −128, so 11111111 = −128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = −1. Read as unsigned, the same pattern is 255.
How large a number can I convert?
Up to 400 digits. The tool uses exact whole-number arithmetic, so long values keep every digit.
Sources and checks
Last checked: 3 November 2026. This tool passes 11 automatic tests before every release. How we check our tools
Cite this page
Number Base Converter (Binary, Octal, Decimal, Hex). GlanceDesk Compute. Last checked 3 November 2026. https://glancedeskcompute.com/
Your numbers stay on your device unless you share them.
For learning and everyday engineering work. Check bit widths against your own processor or protocol documentation. Results are estimates for planning and learning. They are not a design check and do not replace a qualified engineer or your local building/electrical code.