# The Number toString() method

> Learn how the JavaScript Number toString() method returns a string representation of a number, and how the optional radix prints it in binary, octal, or hex.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2019-03-19 | Topics: [JavaScript](https://flaviocopes.com/tags/js/) | Canonical: https://flaviocopes.com/javascript-number-tostring/

This method returns a string representation of the Number object. It accepts an optional argument to set the radix:

```js
new Number(10).toString() //10
new Number(10).toString(2) //1010
new Number(10).toString(8) //12
new Number(10).toString(16) //a
```
