Skip to main content
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 Use Binary and Hex Calculator

Step by step, start to finish.

1

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

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

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.

Key Features

What this tool does, and what it does not do.

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 Hex Calculator

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

Common questions about this tool.

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. Binary and hex arithmetic is digit work, and it is done here in the page. The values you type never leave this tab, online or off.
Advertisement Slot (Bottom Banner) Google AdSense Unit • Responsive Banner