Free Online Binary and Hex Calculator With Bit View
Add, subtract, multiply, divide and apply bitwise operations to numbers written in binary, octal, decimal or hexadecimal. The arithmetic uses big integers, so a shift past 32 places gives the right answer where a browser normally wraps around, and every result is shown in all four bases with its bits laid out.
The sum runs in your browser. Nothing you type is sent anywhere.
💻 The numbers
Each number has its own base, so a hex value and a decimal one can be combined directly. Prefixes like 0x and 0b are accepted and ignored.
Both numbers and the result, lined up bit by bit at the width you chose.
| What | Bits |
|---|
| When | Calculation | Actions |
|---|
Number formatting
Rounding only changes what you see. The sum itself always runs at full precision, so a rounded number never feeds into the next step.
Display
Full screen hides the page around the tool. Press Escape, or the button in the bar, to come back.
History
Your data
Settings, history and saved setups live in this browser and nowhere else. There is no account and no server, which also means clearing them here is final.
Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.
How to Do Binary and Hex Arithmetic
Three steps, and the third is the one to look at.
What to Know About Bitwise Operations
Where the 32 bit limit bites, and what each operation does.
Key Features & Capabilities
What it does, and what it deliberately does not.
About Binary and Hexadecimal Arithmetic
Binary and hexadecimal are how computers are described rather than how they work: the machine stores bits, and these are two convenient ways of writing them down. Hexadecimal is convenient because sixteen is a power of two, so each hex digit stands for exactly four bits and a byte is two tidy characters instead of eight. Octal survives for the same reason with three bits per digit, mainly in file permissions.
The bitwise operations are the ones worth understanding properly. AND keeps a bit only where both numbers have one, so it is used to mask out the parts of a value you do not want. OR keeps a bit where either has one, so it is used to combine flags. XOR keeps a bit where exactly one has it, which makes it the natural way to find what differs between two values, and means that applying the same XOR twice gets you back where you started. Shifting left by one place doubles a number and shifting right halves it, which used to be how multiplication by powers of two was done quickly.
There is a specific reason this page exists rather than just reaching for a browser console. JavaScript converts both operands to signed 32 bit integers before any bitwise operation, and the shift amount itself is taken modulo 32. So one shifted left by 35 places gives 8, not 34359738368, and nothing warns you. Anything above about two thousand million is silently truncated. For a tool whose only job is to get bitwise answers right, that is unacceptable, so everything here runs on big integers, which have no width limit at all.
The other decision is to put the width on screen rather than assuming one. Flipping every bit of five gives minus six if you think of the number as having infinitely many leading ones, 250 if you think of it as eight bits, and 65530 if you think of it as sixteen. All three are correct answers to different questions, and which one you want depends entirely on the register or field you are working with. Asking is better than guessing.
Frequently Asked Questions
Bases, widths, shifts and negative numbers.