Working with numbers outside a spreadsheet often means context-switching between specialized tools — a percentage calculator here, a random number generator there, a base converter somewhere else. Combining these common operations into a single tool saves time and keeps all operations running locally in the browser for privacy. The sections below cover the five number-oriented operations that come up most often in everyday work, the specific use cases each is designed for, and how the underlying math works for the operations that have subtle implementation choices.

Percentage Operations: The Five Modes That Actually Matter

Percentage math is deceptively subtle because several different operations share the same general form but produce different results. This tool implements five distinct percentage modes, each targeting a specific real-world question. Percentage Of asks "what is X% of Y?" — used for sales tax calculations, tip amounts, and discount computations. The formula is simple multiplication: X% × Y = X/100 × Y. Percentage Change asks "what percentage did value grow from old to new?" — used for year-over-year comparisons, investment returns, and performance metrics. The formula is (new − old) / |old| × 100, with the absolute value in the denominator correctly handling negative baselines. Percentage Difference asks "how different are these two peer values?" — used for comparing measurements where neither is the reference. The formula uses the average of both values as the denominator: |a − b| / ((a+b)/2) × 100. Reverse Percentage asks "what was the original value before this percentage change?" — used for un-applying taxes or markups. And Percentage Solver fills in any missing piece of "X is Y% of Z" when you know two of the three. Using the right mode matters because using the wrong formula produces convincing-looking but incorrect results, and many real-world errors in business reporting trace back to mis-applied percentage math.

Random Numbers and Why Math.random Is Fair Enough for Most Uses

The Random/Dice tab covers two distinct categories: generating random integers within a specified range, and rolling virtual dice in standard notation (3d6, 1d20, 2d10+4). Both rely on the browser's built-in Math.random() function, which produces a uniformly distributed floating-point value in [0, 1) on every call. For general-purpose random number generation — dice rolls, random sampling, drawing names from a list, generating non-security-sensitive random IDs — Math.random is more than adequate. Modern browsers implement it with an xorshift128+ variant that has excellent statistical properties for non-cryptographic use, and the uniformity across [0, 1) translates directly to uniform distributions over any integer range through the scaling formula. For cryptographic use — password generation, session tokens, nonce values, anything where an attacker could exploit predictability — Math.random is not suitable; use `crypto.getRandomValues()` instead. This tool is explicitly for non-cryptographic use, and the Fisher-Yates shuffle option ensures no duplicates when drawing unique values from a range, which matters for drawing cards from a virtual deck or assigning random roommates. The history log keeps recent results visible, and a reproducibility-focused mode allows seeding the generator with a specific string for reproducible test cases.

Base Conversion, Roman Numerals, and Number Properties

The remaining three tabs cover less-common but still practical operations. Base conversion handles decimal, binary, hexadecimal, octal, and any custom base from 2 to 36 (using digits 0–9 plus letters A–Z for values 10–35). The underlying math is positional notation — each digit multiplied by the base raised to its position — and the tool shows all five standard bases simultaneously when you enter a value in any one of them. Binary output includes nibble grouping (spaces every 4 bits) for readability. Roman numerals cover the integers 1 through 3,999 using the standard seven symbols (I, V, X, L, C, D, M), which is the range for which Roman numerals are unambiguously defined — larger values require overlines or other conventions that were never universally standardized. Year Mode converts directly between years and their Roman equivalents (MMXXIV for 2024), which is useful for copyright notices and historical date conversions. Number Properties reports extensive information about any integer: primality (via trial division up to √n), factorization, perfect square/cube detection, prime factors with multiplicity, Fibonacci membership, GCD and LCM with a second input, abundance classification (abundant/deficient/perfect), triangular number detection, and a few others. For numbers up to 10 million the properties compute instantly; for larger values trial division becomes the bottleneck and may take a moment.