Skip to content
gohacks.dev
Web

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)

Binary1111 1111 0111 1010
Octal177572
Decimal65,402
HexFF7A
Base 361egq
Bit length16
32-bit pattern (hex)0000FF7A
32-bit pattern (binary)0000 0000 0000 0000 1111 1111 0111 1010
As unsigned65402
As signed65402

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.

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.

Share

Frequently asked questions

How do I convert hex to decimal?
Paste the hex value, with or without 0x, and read the Decimal row. Each hex digit is four bits, so FF is 255.
What is 0xFF in binary?
11111111: eight bits all set, 255 in decimal.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools