piapia123
en

Radix Calculator

Convert

Everything runs locally in your browser — nothing is uploaded

Input
Drop a file here to load its contents
Output

Add, subtract, multiply and divide in binary, octal, decimal and hexadecimal. No overflow wraparound. Some hex calculators truncate results to 32 or 64 bits (`0xFFFFFFFF + 1` gives `0`) — that is simulating a machine word, not doing arithmetic. A calculator should first answer what the two numbers add up to. When you do want masking or wraparound, use the bitwise calculator, where the bit width is an explicit parameter and the reduction is visible. Division reports a quotient and a remainder rather than quietly becoming a fraction. Integer division has two conventions worldwide: truncation toward zero (C, JavaScript’s BigInt) and flooring (Python). `-7 ÷ 2` gives −3 remainder −1 under the first and −4 remainder 1 under the second — both correct, depending on which you want. So this tool does not pick a side: when the division is not exact, the remainder is listed alongside. A prefix beats the selected base. If you write `0x`, `0o` or `0b`, that is what it is parsed as, even if the dropdown says otherwise — there is no other way to write something like `0b1010 + 0xFF`.

Features

  • Four operations: add, subtract, multiply and divide, negatives included
  • Binary, octal, decimal and hex for both input and output, and they can differ
  • Prefixes win: mixed input like `0b1010 + 0xFF` is expressed that way
  • Division reports the quotient, plus the remainder when it is not exact (truncated toward zero)
  • Exact on integers of any size — `0xFFFFFFFF × 0xFFFFFFFF` is not truncated
  • A decimal reading is added whenever the result is not in decimal
  • One operand per line, so a whole list can be run against the same number
  • Underscores and spaces act as digit separators

How to use

  1. Paste the first operand, one per line
  2. Choose the input base and operation, then fill in the second operand
  3. Change the output base if you want the result in another one
  4. Copy a single value from its row

FAQ

Why is the result negative instead of a big wrapped value?
Because this tool does arithmetic, not machine-word simulation. `0x00 - 1` gives `-0x1`, not `0xFFFFFFFF`. Wraparound depends on the word size of a real system (32-bit, 64-bit or something else), and picking one for you would be guessing. To reduce modulo a fixed width, use the bitwise calculator, where subtraction wraps naturally once a width is chosen.
What happens when the division is not exact?
You get a quotient and a remainder, both integers and both in the base you chose. In hex, `FF ÷ 10` is `F` remainder `F` (255 = 15 × 16 + 15). The reason is that “integer division” has two common conventions — truncation toward zero and flooring — which disagree on negatives (`-7 ÷ 2` is either −3 remainder −1 or −4 remainder 1). Handing you the remainder avoids picking a side.
Can it handle fractions?
No, for two reasons. `0.1` is a repeating fraction in binary, so any written form is an approximation; and fractional arithmetic in hex has no common convention at all. Integer arithmetic covers the overwhelming majority of real needs — address offsets, masks, colour values, protocol fields — and for decimals the decimal tools or an ordinary calculator are the right choice.

Related tools