Skip to main content
WizTools123
WizTools123
Free Online Tools

Tool Categories


Math Tools New Tool

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.

Free Forever Nothing Uploaded No 32 Bit Limit Bits Laid Out
Free Online Binary and Hex Calculator With Bit View
Share this tool
Advertisement Slot (Top Banner) Google AdSense Unit • Responsive Banner
💻 Binary and Hex Calculator Four bases · arithmetic and bitwise · every bit shown

The sum runs in your browser. Nothing you type is sent anywhere.

What to work out

💻 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.

Width for the bit view and for NOT
Flipping every bit only has an answer once you say how many bits there are. The width also sets how many leading zeros the bit view shows.
Try one of these
The fourth gives 8 in a browser console and 34359738368 here, which is the right answer.
The result
—
Binary—
Octal—
Decimal—
Hexadecimal—
Bits set—

Both numbers and the result, lined up bit by bit at the width you chose.

What Bits
Buy Us A Coffee

Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.

Buy Us A Coffee
Sponsored Content (Below Tool) Google AdSense Placement

How to Do Binary and Hex Arithmetic

Three steps, and the third is the one to look at.

1
Enter the two numbers with their bases Each has its own base button, so a hexadecimal value and a decimal one can be combined without converting either first. Prefixes such as 0x and 0b are accepted and ignored.
2
Choose the operation Add, subtract, multiply, divide with remainder, or the bitwise operations: AND, OR, XOR, NOT and the two shifts. Flipping every bit needs a width, which is why one is always set.
3
Look at the bit view Both inputs and the result lined up bit by bit. For a bitwise operation this is the answer made visible, column by column, which is more convincing than the number alone.

What to Know About Bitwise Operations

Where the 32 bit limit bites, and what each operation does.

A browser gives the wrong answer past 32 bits. JavaScript converts its operands to 32 bit integers before any bitwise operation, so one shifted left by 35 places comes out as 8 rather than 34359738368. The shift amount wraps around at 32 and the result is silently wrong. Since getting bitwise answers right is the whole point of this page, the arithmetic here uses big integers, which have no width limit, and the answer is correct at any size.
Flipping every bit needs a width. The mathematical complement of five is minus six, because the ones extend infinitely to the left. The answer most people want is the one inside a fixed number of bits: in eight bits it is 250, in sixteen it is 65530. Neither is more correct than the other, they are answers to different questions, so the width is on screen rather than assumed.
Each operation has a plain meaning. AND keeps a bit only where both numbers have it, which is how a mask selects part of a value. OR keeps a bit where either has it, which is how flags are combined. XOR keeps a bit where exactly one has it, which is how differences are found and why applying it twice restores the original. A shift left multiplies by two for each place, and a shift right divides.
Every result in all four bases. Someone working in hexadecimal usually wants to see the binary a moment later, and the decimal value to sanity check it. Showing all four removes a step and makes an error in the input obvious, because a wrong reading usually looks wrong in decimal even when it looks plausible in hex.
Division gives a quotient and a remainder. Integer division is what matters when working with bits and addresses, so the answer is the whole number of times it goes in, with what is left over alongside. A decimal fraction would be the wrong kind of answer here.
It runs in your browser with nothing uploaded. The arithmetic is in the page, so it works offline once loaded and nothing you type is sent anywhere.

Key Features & Capabilities

What it does, and what it deliberately does not.

Four bases in, four out Binary, octal, decimal and hexadecimal, with each input having its own base.
No 32 bit limit Big integer arithmetic, so a shift past 32 places gives the right answer instead of wrapping.
The bits laid out Both inputs and the result lined up at your chosen width, grouped in fours.
Width always visible Because flipping every bit has a different answer in 8, 16, 32 and 64 bits.
Arithmetic too Add, subtract, multiply and divide with remainder, all in whichever base you are working in.
Nothing is uploaded It runs in this tab and keeps working offline.

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.

Because JavaScript does bitwise work on 32 bit integers and takes the shift amount modulo 32. One shifted left by 35 becomes one shifted left by 3, which is 8. This page uses big integers, so it gives 34359738368.

Because flipping every bit has no answer without one. In eight bits the complement of five is 250, in sixteen it is 65530, and mathematically it is minus six. The width also sets how many leading zeros the bit view shows.

Masking. ANDing with a value that has ones only where you care keeps those bits and clears the rest, which is how a field is extracted from a packed value.

Because it produces a one exactly where the two inputs disagree. The result is a map of what changed, and applying the same XOR again restores the original, which is why it appears in checksums and simple encodings.

Yes. Each input has its own base setting, so a hexadecimal mask can be applied to a decimal value without converting anything first.

As integer division, with the quotient and the remainder both shown. That is the form that matters when working with bits, addresses and alignment; a decimal fraction would not be useful here.

No. The arithmetic runs in your browser, so nothing you type leaves the page and it works offline.

Related Tools

Advertisement Slot (Bottom Banner) Google AdSense Unit • Responsive Banner