How to use
- Enter a number and choose which base it’s written in. Prefixes like
0x1F,0b1010or0o17are recognized automatically. - Binary, octal, decimal and hex results appear in a table; each row has its own Copy button. Add any other base, such as 3 or 36, under “Extra base to show”.
- In the Two’s complement section, see the bit pattern an 8-, 16-, 32- or 64-bit integer would store, and what that pattern means read as unsigned or signed.
How base conversion works
Each digit in base N stands for a power of N. To get decimal, multiply each digit by its place value and add; to go from decimal, divide by N repeatedly and read the remainders backwards.
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 10 | 1010 | 12 | A |
| 255 | 1111 1111 | 377 | FF |
| 256 | 1 0000 0000 | 400 | 100 |
| 65,535 | 1111 1111 1111 1111 | 177777 | FFFF |
Example: hex 1F = 1×16 + 15 = 31. Four binary digits map exactly to one hex digit and three to one octal digit, which is why programmers abbreviate long binary values in hex. Base 36 uses 0–9 plus a–z as digits.
What is two’s complement?
Most computers store negative integers in two’s complement: in N bits, −x is stored as the bit pattern of 2ᴺ − x. So the 8-bit pattern 1111 1111 is 255 read as unsigned, and −1 read as signed.
| Width | Signed range | Unsigned range |
|---|---|---|
| 8 | −128 to 127 | 0 to 255 |
| 16 | −32,768 to 32,767 | 0 to 65,535 |
| 32 | −2,147,483,648 to 2,147,483,647 | 0 to 4,294,967,295 |
| 64 | −9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 | 0 to 18,446,744,073,709,551,615 |
A value outside the range keeps only its lowest N bits (overflow); the tool warns you and shows what remains.
Things to watch out for
- Integers only — numbers with a fractional part aren’t supported.
- Ordinary JavaScript numbers lose precision past 2⁵³ (about 9 quadrillion). This tool uses BigInt, so even numbers thousands of digits long convert exactly.
FAQ
How do I turn text into binary?
To convert characters into binary or hex bytes, use the Text ↔ Binary Converter.
Is my input stored?
No. Everything is calculated in your browser and nothing is uploaded.