Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The Number() constructor creates Number objects. When called as a function, it returns primitive values of type Number.
Note: Number() can be called with or without new, but with different effects. See Return value.
The numeric value of the object being created.
When Number() is called as a function (without new), it returns value coerced to a number primitive. Specially, BigInts values are converted to numbers instead of throwing. If value is absent, it becomes 0.
When Number() is called as a constructor (with new), it uses the coercion process above and returns a wrapping Number object, which is not a primitive.
Warning: You should rarely find yourself using Number as a constructor.
Number() is the only case where a BigInt can be converted to a number without throwing, because it's very explicit.
Note that this may result in loss of precision, if the BigInt is too large to be safely represented.
| ECMAScript® 2027 Language Specification # sec-number-constructor |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 10, 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.