User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

About

Positional numeral systems encode quantity through digit placement relative to a radix r. A single misread digit in a hexadecimal memory address corrupts an entire data segment. Firmware engineers routinely convert between base-2, base-8, base-16, and base-10 under time pressure where manual errors cascade into hardware faults. This calculator performs exact arbitrary-precision integer arithmetic and conversion across all standard bases from 2 to 36, using digits 0 - 9 and letters A - Z. It validates every digit against the selected radix before computation, eliminating silent truncation bugs found in many online converters.

The tool handles numbers exceeding 264 via arbitrary-precision integer support. Arithmetic operations (addition, subtraction, multiplication, integer division, modulo, exponentiation) and bitwise operations (AND, OR, XOR, NOT, left/right shift) are computed exactly. Note: fractional base conversion uses fixed precision of 20 fractional digits and may exhibit rounding in non-terminating expansions (e.g., 0.1 in base 10 is non-terminating in base 2).

base converter number system calculator binary calculator hex calculator octal calculator radix conversion base-n arithmetic numeral system

Formulas

A number N expressed in base r with digits dk has the decimal value:

N = nโˆ‘k=0 dk โ‹… rk

where dk โˆˆ {0, 1, โ€ฆ, r โˆ’ 1} and k = 0 is the least significant digit.

To convert a decimal integer to base r, repeatedly divide by r and collect remainders in reverse order:

dk = N mod r , N โ† โŒŠNrโŒ‹

For fractional parts, multiply by r and extract integer parts successively. This process may not terminate (e.g., 0.110 in base 2 is 0.0001100110011โ€ฆ).

Bitwise operations treat the number as a binary string. For two integers a and b:

a AND b โ†’ bit-by-bit logical conjunction
a OR b โ†’ bit-by-bit logical disjunction
a XOR b โ†’ bit-by-bit exclusive or
NOT a โ†’ bitwise complement
a << n โ‰ก a ร— 2n
a >> n โ‰ก โŒŠa รท 2nโŒ‹

where r = radix (base), dk = digit at position k, N = numeric value, n = number of digit positions or shift amount.

Reference Data

BaseNameDigits UsedCommon UseExample: 25510
2Binary0-1Digital circuits, CPU instructions11111111
3Ternary0-2Balanced ternary computers, information theory100110
4Quaternary0-3DNA nucleotide encoding3333
5Quinary0-4Tally systems, Bi-quinary coded decimal2010
6Senary0-5Dice notation, some natural languages1103
7Septenary0-6Days of the week, historical calendars513
8Octal0-7Unix file permissions, PDP-11 architecture377
10Decimal0-9Human counting, finance, science255
12Duodecimal0-9, A - BTime (12 hours), imperial units (dozen)193
16Hexadecimal0-9, A - FMemory addresses, color codes, MAC addressesFF
20Vigesimal0-9, A - JMaya numerals, French numbering (quatre-vingts)CF
32Base320-9, A - VCrockford encoding, TOTP secret keys7V
36Base360-9, A - ZURL shorteners, compact alphanumeric IDs73
58Base58 *Alphanumeric minus 0OIlBitcoin addresses, IPFS hashesNot supported (non-standard)
64Base64 *A - Z, a - z, 0-9, +/Email encoding (MIME), data URIsNot supported (encoding, not positional)

Frequently Asked Questions

The fraction 0.110 = 110, and 10 has a prime factor of 5 which is not a factor of 2. A fraction terminates in base r only when its denominator (in lowest terms) has no prime factors other than those of r. Since base 2 only contains the prime factor 2, any denominator with a factor of 5 produces a non-terminating binary expansion. This calculator truncates at 20 fractional digits.
JavaScript's Number type uses IEEE 754 double-precision floats, which lose integer precision above 253. This tool uses BigInt for all integer arithmetic, supporting arbitrary-precision integers limited only by available memory. Fractional parts use a scaled-integer approach: multiply the fractional digits by r20, convert as BigInt, then reinsert the radix point.
For any base r from 11 to 36, digits 0 - 9 represent values 0-9, and letters A - Z represent values 10-35. Input is case-insensitive. For base 16, valid digits are 0 - 9 and A - F. Entering a digit whose value equals or exceeds the base (e.g., F in base 15) triggers a validation error.
For fixed-width integers (8, 16, 32, 64 bits), NOT flips every bit. For arbitrary-precision BigInt, JavaScript defines NOT(a) = โˆ’(a + 1), equivalent to two's complement with infinite sign extension. This calculator uses that definition. Positive inputs yield negative results and vice versa.
No. This tool converts mathematical numeric values between positional numeral systems. It does not display the internal IEEE 754 binary encoding (sign bit, exponent field, mantissa). For that purpose, use a dedicated IEEE 754 analyzer. The fractional conversion here shows the mathematical base-r expansion, not the hardware storage format.
Integer division truncates toward zero, matching the behavior of most programming languages (C, Java, Python's // operator). The remainder (modulo) operation is also provided. For example, 7 รท 2 = 3 with remainder 1. The tool displays both quotient and remainder when performing division.