Binary Arithmetic and Overflow (Why 255 + 1 Is 0)
The same eight bits are 200 unsigned and −56 signed
About Binary Calculator — Free Online Tool
Binary Calculator does arithmetic and bitwise operations in binary, octal, decimal or hex at a chosen register width, and tells you when the answer overflowed rather than silently wrapping.
BigInt throughout, so a 64-bit operand is exact — JavaScript’s own bitwise operators truncate to 32 bits. The exact value and the wrapped value are both reported, with the two’s-complement reading.
Base conversion and arithmetic happen in the page itself. No operand is transmitted.
Checking a bitmask, understanding an integer overflow, converting between bases while calculating, and seeing what a shift really does.
Also known as: binary addition calculator · bitwise calculator · hex calculator · twos complement calculator · bit shift calculator
When to use it
Because the interesting part of binary arithmetic is what happens at the edge of the register, and a calculator that hides the overflow hides the only thing you needed to see.
How it works
Operands are parsed in the chosen base into arbitrary-precision integers, the operation is applied exactly, and the result is then shown both exact and wrapped to the register width.
Overflow Is Reported, Because It Is The Answer
Add 1 to 255 in an 8-bit register and you get 0. That is not a mistake, it is what the hardware does — the ninth bit has nowhere to go. A calculator that quietly returns 256 is answering a different question from the one a programmer asked. Here both numbers are shown: the exact value, and what the register holds. Odometer rollovers, the Year 2038 problem and a great many security bugs are all this one behaviour.
The Same Bits, Two Different Numbers
11001000 is 200 if you read it as unsigned and −56 if you read it as two’s complement, because the top bit carries a weight of −128 instead of +128. Nothing about the bits changes; only the interpretation does. This is why a C program comparing a signed char against 200 behaves strangely, and why both readings are printed here for every result.
Shifts Are Multiplication, Until They Are Not
A left shift by n multiplies by 2ⁿ and a right shift divides by it, which is why compilers turn x * 8 into x << 3. The difference is at the edges: a left shift throws away the bits that fall off the top, and a right shift floors rather than rounding, so −7 >> 1 is −4 and not −3.5 or −3. Treating a shift as exact division is a reliable source of off-by-one errors in rounding code.
Why BigInt And Not JavaScript’s Own Operators
JavaScript’s &, | and << coerce their operands to 32-bit signed integers. Feed them a 64-bit value and the top half is silently discarded, so a calculator built on them gives wrong answers for exactly the large operands you would reach for a tool to check. This one uses BigInt, computes the exact value first, and applies the register width afterwards as a deliberate step.
How to Use Binary Calculator in 4 Easy Steps
Follow this simple guide to process your files in seconds directly inside your browser tab.
Provide Input for Binary Calculator
Paste your payload, code snippet, or string into the Binary Calculator editor workspace. A calculator that works in whichever base you are reading, with the bitwise operations a processor actually has, at a register width you choose.
Configure Formatting & Validation Rules
Select indentation preferences, minification, encoding options, or validation rules. Because the interesting part of binary arithmetic is what happens at the edge of the register, and a calculator that hides the overflow hides the only thing you needed to see.
Run In-Browser Engine
The engine executes Binary Calculator locally in your browser with microsecond latency and zero server transmission.
Copy or Download Output
Copy the sanitized, formatted, or generated output directly to your clipboard or download it for your project.
Why Use Binary Calculator on ShortTrick
Engineered for maximum speed, strict privacy, and frictionless digital productivity.
Zero Code or Token Leaks
Proprietary source code, API keys, database queries, and tokens processed in Binary Calculator never leave your browser.
Microsecond Performance
Optimized AST parsers and Web Crypto APIs process large payloads in Binary Calculator in milliseconds.
Syntax Validation & Formatting
Binary Calculator highlights syntax errors and enforces standard formatting conventions automatically.
Offline Ready
Once loaded, Binary Calculator functions entirely offline without requiring an active internet connection.
Frequently Asked Questions About Binary Calculator
Common questions regarding Binary Calculator, data privacy, file format compatibility, and usage limits.
Popular Searches & Related Tasks for Binary Calculator
Common search phrases, secondary format tasks, and workflows users reach for when using this tool.
Direct Variations & Search Synonyms (8)
Specific Workflows & Long-Tail Queries (15)
Semantic Standards & Technical Entities (20)
Binary, octal, decimal, hexadecimal
The same quantity written four ways. Hexadecimal is the one worth understanding properly, because it is not arbitrary: one hex digit is exactly four bits, so a byte is always exactly two hex digits, and that is the whole reason colours, memory addresses and file signatures are written in it.
| Base | Digits | The number 255 | Where you meet it | |
|---|---|---|---|---|
| Binary | 2 | 0-1 | 11111111 | Flags, permissions, logic |
| Octal | 8 | 0-7 | 377 | Unix file modes |
| Decimal | 10 | 0-9 | 255 | Everywhere else |
| Hexadecimal | 16 | 0-9 A-F | FF | Colours, addresses, hashes |
| Roman | None | I V X L C D M | CCLV | Clocks, titles, dates |
In practice: A chmod value like 755 is octal because each digit holds exactly three permission bits, which is why the digit 8 never appears in one. Roman numerals are not a base at all: they are additive, have no zero and no fractions, and cannot express anything below one, so a conversion to them from a decimal with a fractional part always loses something.
Related Developer Tools Tools & Popular Utilities
Explore complementary browser-based tools with zero file uploads and instant in-memory execution.
More Developer Tools Tools
Popular Tools Across Other Categories
Related Reading & Tutorials
Guides, articles, and best practices for developer tools workflows.

Binary Arithmetic and Overflow (Why 255 + 1 Is 0)

How to Use Timesheet & Hours Calculator Online: Step-by-Step Guide
