Number Base Converter
Convert numbers of any size between binary, octal, decimal, hex and base 36, and see their 8, 16, 32 or 64-bit two's complement form.
Free · No sign-up · Your inputs stay in your browser
Input
Convert between binary, octal, decimal and hex
Output
65402 (read as base 16)
| Binary | 1111 1111 0111 1010 |
|---|---|
| Octal | 177572 |
| Decimal | 65,402 |
| Hex | FF7A |
| Base 36 | 1egq |
| Bit length | 16 |
| 32-bit pattern (hex) | 0000FF7A |
|---|---|
| 32-bit pattern (binary) | 0000 0000 0000 0000 1111 1111 0111 1010 |
| As unsigned | 65402 |
| As signed | 65402 |
Two's complement is how a negative number is stored in a fixed number of bits: -1 is all ones. That is also why a hex value with the top bit set, such as 0xFFFFFFFF, reads as -1 in a signed 32-bit integer and 4294967295 unsigned.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Two's complement
Fixed-width integers store negative numbers as two's complement: invert the bits of the positive value and add one. That is why -1 is all ones (0xFFFFFFFF in 32 bits), why the same bits read as 4,294,967,295 unsigned, and why a counter that overflows a signed 32-bit integer jumps from 2,147,483,647 to -2,147,483,648.
Large numbers in JavaScript
JavaScript numbers are doubles, exact only up to 253. A 64-bit ID parsed with parseInt loses its last digits; BigInt, which this tool uses, does not. That is also why APIs return 64-bit IDs as strings.