Base Calculator
Calculate in any number base from 2 (binary) to 36 — hex, octal and decimal included. Add, subtract, multiply, divide, mod, raise to a power, shift and combine with bitwise AND, OR, NOT or XOR, then read the result in the base you chose plus decimal and binary, with every conversion step shown.
Pick the base and enter the first number
Choose the base of your operands — 2 (binary), 8 (octal), 10 (decimal), 16 (hex) or any base up to 36 — then type the first number using only that base’s digits. Letters A to Z stand for values 10 to 35, upper or lower case.
Choose the operation and the second number
Pick +, -, ×, ÷, mod, exp (power), and, or, not, xor, left shift or right shift, then type the second number in the same base. NOT (~) works on the first number alone. Division and right shift show any leftover as "quotient R remainder" so nothing is lost.
Press Calculate and read the result
The result appears in your chosen base plus ready-to-copy Decimal and Binary lines (the Calculation steps block converts to decimal and back so you can learn the method). Digit grouping inserts readable separators, and the expression box below handles whole formulas like 0x1A + 2*3.
Base calculation examples
| base | first | op | second | result | decimal | binary |
|---|---|---|---|---|---|---|
| 16 (hex) | 1A | + | 2B | 45 | 69 | 1000101 |
| 2 (binary) | 1101 | + | 1011 | 11000 | 24 | 11000 |
| 8 (octal) | 25 | ÷ | 3 | 7 | 7 | 111 |
| 10 (decimal) | 17 | ÷ | 5 | 3 R 2 | 3.4 | 11 |
| 10 (decimal) | 2 | exp | 10 | 1024 | 1024 | 10000000000 |
| 36 | Z | + | 10 | 1Z | 71 | 1000111 |
Number bases at a glance
A number base says how many digits each position holds: binary (base 2) uses 0-1, octal (base 8) 0-7, decimal (base 10) 0-9 and hex (base 16) 0-9 A-F. Anything higher borrows letters too, so base 36 ends at Z = 35. Each position is worth a power of the base: 1A₁₆ = 1×16 + 10 = 26, and 1101₂ = 8 + 4 + 1 = 13. The two proven ways to calculate are exactly what the Calculation steps block shows: convert each number to decimal, calculate, convert the result back — or work directly in the chosen base.
How this calculator works
- Why does division show something like "3 R 2"?
- When the divisor does not fit a whole number of times, the result line shows the integer quotient and the remainder (3 remainder 2), while the Decimal line shows the exact fractional quotient — 17 ÷ 5 gives "3 R 2" and 3.4 at once. The identity divisor × quotient + remainder = dividend always closes, and the remainder keeps the sign of the first number.
- How do the bitwise operations behave?
- and, or, not and xor work on 32-bit two’s-complement numbers, the same limit most programming languages apply: operands are wrapped into 32 bits before the operation, and NOT returns the unsigned 32-bit complement (so ~5 becomes 4294967290, FFFFFFFA in hex). Left and right shift instead keep full precision — they multiply or divide by powers of two — with right shift also reporting any leftover as a remainder.
- How do I use the expression box?
- Type a whole formula in one line using 0x for hex, 0b for binary and 0o for octal, e.g. 0x1A + 2*3. Supported are + - * / mod, ^ for powers, parentheses, and bitwise & | ~ << >> plus the xor keyword; every result is shown in binary, octal, decimal and hex at the same time. Division stays whole-number: 10 / 4 gives 2.
- Are large numbers exact?
- Yes — ordinary floating point silently rounds integers past about 15 digits, but this tool computes with exact whole-number arithmetic in your browser tab, so binary results stay exact thousands of digits long and digit grouping (spaces every 3 or 4 digits) never changes the underlying value.
Privacy: this calculator runs entirely in your browser tab. Your input and results are never uploaded, stored, or shared.