Get to know MDN better
The JavaScript exception "invalid BigInt syntax" occurs when a string value is being coerced to a BigInt but it failed to be parsed as an integer.
When using the BigInt() function to convert a string to a BigInt, the string will be parsed in the same way as source code, and the resulting value must be an integer value.
This page was last modified on Jul 8, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.