bigint · arbitrary precision · multi-base · local

Big integer arithmetic in every base

Add, subtract, multiply, divide, or mod arbitrarily large integers with native BigInt. Operands accept hex, binary, octal, decimal — results shown in all four bases.

Big Integer Arithmetic
Status
ready
live
Digits
49
decimal
Operator
*
infix
Output
49 B
all bases
Operation:
input · operands

Accepts 0x hex · 0b binary · 0o octal · plain decimal. Underscores ignored.

output · result in 4 bases
decimal · 49 digits
1980949486431096193954443913393463441853113342940
hex · 41 digits
0x15afcd8de690073a216a7e826ba6a6cdc51029bdc
binary · 161 digits
0b10101101011111100110110001101111001101001000000000111001110100010000101101010011111101000001001101011101001101010011011001101110001010001000000101001101111011100
octal · 54 digits
0o255374661571510007164205523750115351523315612100515734
Quick Start

Compute with arbitrary precision

JavaScript BigInt removes the 2^53 safe-integer ceiling. Numbers stay exact no matter how many digits — your CPU is the only limit.

  1. 01

    Type operand A

    Use 0x for hex, 0b for binary, 0o for octal, or just decimal digits.

    Inputs are treated as UTF-8 throughout the pipeline and validated client-side as you type — nothing dispatches until the value is well-formed.

    inpututf-8client-sidevalidated
    A · textdec · set
    123456789012345678901234567890
    loaded · parsedclient-side
  2. 02

    Pick the operator

    + − × ÷ mod — exact integer arithmetic, no rounding.

    Each toggle re-computes through a memoised hook, so flipping options never resets your input and the UI stays snappy on large inputs.

    opoptionslivememoisedtoggles
    op · memoised× · live
    multiply
    options set · memoisedlive
  3. 03

    Type operand B

    Mix bases freely — hex × decimal works fine.

    Randomness — where used — comes from crypto.getRandomValues, never Math.random. Heavy work sits in useMemo.

    inputcomputeinstantlocaldeterministic
    B · instanthex · computed
    0xdeadbeefcafebabe
    computed · instantinstant
  4. 04

    Read every base

    The exact result appears in decimal, hex, binary, and octal — click copy on any.

    Copy writes through navigator.clipboard and downloads use a Blob — zero network traffic. Same input plus same options always yield the same bytes.

    exportcopydownloadzero-networkreproducible
    ok · copiedready · copied
    copied
    shipped · ready to shipsuccess
Pro tips

Pro tips for everyday utilities

Reach for crypto.getRandomValues

Cryptographically random for IDs, tokens, salts. Math.random is for animation and games, not security.

Sort IDs lexicographically

UUID v4 has no time ordering. Use ULID or UUID v7 if you need sorted IDs.

Mock data with seeds

Faker-style libraries can be seeded so tests are reproducible. Embed the seed in the fixture file.

Reference cards beat memory

Cheatsheets for Vim, Git, Docker, Linux signals are faster than man pages when you’re mid-flow.

Browser APIs vary

Touch events, gamepads, and clipboard differ across vendors. Feature-detect before use.

Persist in the right place

localStorage for user preferences, sessionStorage for transient state, IndexedDB for structured data.

Use Cases

When you need BigInt

Cryptography, combinatorics, finance, science.

Crypto primes

Multiply 2048-bit prime candidates without overflow. Random values come from crypto.getRandomValues — cryptographically secure for tokens, salts, and session IDs. Math.random is deterministic enough for animations but predictable enough to be a security bug.

CSPRNG-backed

Combinatorics

Combinatorial counts blow past 2^53 instantly — BigInt keeps them exact. Pair with hashids, ULID, or UUID v7 when you need both random and sortable — useful for primary keys, public-facing IDs, and event log ordering without a sequence column.

reproducible

Currency micros

Track exact integer cents or satoshis across millions of transactions. Output is deterministic given the same seed, so fixtures and tests stay reproducible across CI runs and contributor machines. Embed the seed in the fixture file for full replay.

snappy

Hash mixing

Test bitwise mixing logic with full-width 64-bit values. Heavy work runs through useMemo so the UI stays snappy on large inputs. Same input + same options yields identical bytes — the kind of stability snapshot tests rely on.

feature-detected

Scientific exponents

Verify back-of-the-envelope big-number estimates. Storage tools persist to the right backend: localStorage for user preferences, sessionStorage for transient state, IndexedDB for structured data. Pick the right shelf and quota worries disappear.

deterministic

Teaching BigInt

Demonstrate base conversion and exact arithmetic in classroom. Browser feature detection: clipboard, fullscreen, gamepad, and Web Bluetooth APIs gracefully fall back when unavailable. No surprise white screens on Safari or older Firefox.

production-ready
FAQ

Frequently asked questions

Tens of thousands of digits work fine. Browsers throttle ridiculous multiplications, but everyday cryptographic-size operands are instant.
BigInt division is integer division — fractions are truncated toward zero. Use the mod operator to get the remainder.
BigInt is signed. Prefix any operand with - and arithmetic follows the usual rules.
They're treated as digit separators and stripped before parsing — so 1_000_000 works the same as 1000000.
No. All math runs locally in your browser via native BigInt — nothing leaves the page.
Suggest a tool

Something missing?

Tell us what you need. We ship the top requests every two weeks.

Sent straight to the maintainers · no account needed
47 in queue·8 shipped this month
Request queued. Thanks!