// admin tools · 16
Base shift
Binary, octal, decimal, hex and any base from 2 to 36, live-synced on BigInt so size never matters. Flip bits, check two's complement, take floats apart and do bitwise maths.
// runs locally — nothing is uploaded
two's complement
byte order
- big-endian
- little-endian
- C array
bits · click to flip · MSB left
Operands accept decimal, 0x hex, 0b binary or 0o octal, and may be negative. Shifts and rotates use B as the bit count.
every op
How it works
What it does
Type a number into any field and every other base updates as you type. Values are held as JavaScript BigInt, so a 300-digit decimal converts as easily as 255. Alongside the plain conversions you get a two's complement view at 8, 16, 32, 64 or 128 bits, a clickable bit grid, big- and little-endian byte order, an IEEE-754 float inspector and a bitwise calculator. Everything runs locally in your browser.
How to use it
- Prefixes and separators.
0x,0band0owork in their own fields, and the decimal field accepts any of them. Underscores, spaces and apostrophes are ignored, so0b1010_0101anddead beefare fine. Errors show the column of the bad digit. - Negative numbers keep their sign in the base fields (
-ff). The two's complement panel shows how the same value is stored at the selected width. - Bits. Click or press Enter on any bit to flip it. Bit 0 is the least significant and sits on the right.
Two's complement and widths
A fixed-width register stores n bits. Read as unsigned, they mean 0 to 2n−1. Read as signed two's complement, the top bit is worth −2n−1, giving a range of −2n−1 to 2n−1−1. The pattern 0xff is 255 unsigned and −1 signed at 8 bits. auto picks the smallest of 8, 16, 32, 64 or 128 bits that holds the value, then multiples of 64 beyond that. If a value is too wide for the chosen width, the tool keeps the low bits and warns you, just like a cast in C or Rust.
Floats: IEEE-754
- sign
- 1 bit. 1 means negative, including −0.
- exponent
- 8 bits (float32) or 11 bits (float64), stored with a bias of 127 or 1023. All zeros means zero or subnormal. All ones means infinity or NaN.
- mantissa
- 23 or 52 bits of fraction after an implicit leading 1 (0 for subnormals).
The exact row prints the full decimal expansion of the stored binary value. Every finite float is a finite binary fraction, so this is precise, not rounded. It shows why 0.1 is really 0.1000000000000000055511151231257827… and why 253+1 cannot be stored in a double. ulp is the gap to the next representable float.
FAQ
Is there a size limit?
Not for conversion. BigInt has no fixed size, but very large values (hundreds of thousands of digits) get slow in bases that are not powers of two. The bit grid stops at 256 bits to stay usable. Pick a fixed width to inspect the low bits of anything larger.
What is the difference between >> and >>>?
>> is an arithmetic shift: it copies the sign bit in from the left, so negative numbers stay negative. >>> is a logical shift: it always shifts in zeros. Both work at the selected width, so 64-bit and 128-bit shifts behave like native i64/u64 types rather than JavaScript's 32-bit operators.
Why does a NaN come back as a different bit pattern?
JavaScript may canonicalise NaN when a value passes through a Number, so payload bits can be lost. Type the raw hex bits (for example 7fc00001) to inspect a specific payload.
Does anything leave my browser?
No. All arithmetic happens in JavaScript on this page. Nothing is sent or stored.