Skip to content

Glossary

BigInt

JavaScript's arbitrary-precision integer type

BigInt is a JavaScript primitive type added in ES2020 for arbitrary-precision integer arithmetic. Unlike the regular Number type — which uses IEEE 754 double precision and loses accuracy past about 2⁵³ — BigInt can represent integers of any size.

Literal syntax: append n to a number, or call BigInt(x). Operators like +, -, *, / work, but you can’t mix BigInt with Number — 1n + 1 throws. Division truncates toward zero (integer division).

Where BigInt matters: Ethereum Wei amounts (up to 10¹⁸ per ETH), cryptographic operations (RSA keys, ECC), large database IDs (Snowflake, ULID), counters at scale, financial systems that store cents as integers.

Our Wei / Gwei / ETH converter uses BigInt throughout so 18-digit Wei amounts round-trip without loss. See our crypto methodology for the implementation details.

Related

Published May 14, 2026