---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# Number() constructor

The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful.

## Syntax

```js
new Number(value)
Number(value)
```

> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return-value).

### Parameters

- `value`
  - : The numeric value of the object being created.

### Return value

When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive.

When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx).

> **Warning:** You should rarely find yourself using `Number` as a constructor.
