freesabai

Developer tools

Number base converter and bitwise calculator

Enter a binary, octal, decimal or hexadecimal number (or another base up to 36) and see every base at once, with the signed and unsigned values at 8, 16, 32 and 64 bits, and calculate AND, OR, XOR, NOT and shifts. Numbers of any size stay exact. It runs in your browser.

This tool needs JavaScript. If you still see this after a few seconds, JavaScript is switched off in your browser or the page did not load completely: turn JavaScript on or reload the page.

How to use it

  1. Type a number in the box. Put 0x in front for hex, 0b for binary, 0o for octal, or choose the base yourself. Every base appears at once.
  2. Look at "64-bit signed" to see what negative number it is in two's complement.
  3. Below, enter A and B, choose the operation and the bit width, and get the result in hex, binary and decimal.

Frequently asked questions

Why can this tool handle big numbers exactly?

The ordinary numbers of JavaScript hold whole numbers exactly only up to 2^53 (about 9 quadrillion); beyond that the last digits go wrong. This tool uses BigInt, so every digit is exact. It works with 64-bit numbers and larger, such as 0xFFFFFFFFFFFFFFFF.

What is two's complement, and what are signed numbers?

Computers store a negative number by flipping the bits and adding one. At 8 bits, -1 is 11111111 (255 if read as unsigned). The leftmost bit says the number is negative. The 8, 16, 32 and 64-bit rows show both readings.

What is the difference between a signed and an unsigned right shift?

>> shifts in copies of the sign bit on the left, so a negative number stays negative. >>> shifts in zeros, so the result is always positive. The difference shows with negative numbers.

Good to know

Your data stays on your device

Everything runs in your browser. What you type, paste or open is not sent to freesabai's servers or anyone else's, and is not kept in the browser: close the page and it is gone. The site only counts how many times this page was opened and how many times someone copied or saved a result (never what was pasted or the result, and you can switch the counting off in the footer; see the privacy policy).

Report a problem or suggest an idea

Found a bug, or want this tool to do more? Tell us on the feedback page. No sign-up.

Other developer tools

JSON and data

Encoding, hashes and tokens

Generators

Time, numbers and colour

Text and code