As shown by other answers here, there are multiple ways to do the conversion:

Number('123'); +'123'; parseInt('123'); parseFloat('123.45')

I'd like to mention one more thing on parseInt though.

When using parseInt , it makes sense to always pass the radix parameter. For decimal conversion, that is 10 . This is the default value for the parameter, which is why it can be omitted. For binary, it's a 2 and 16 for hexadecimal. Actually, any radix between and including 2 and 36 works.

parseInt('123') // 123 (don't do this) parseInt('123', 10) // 123 (much better) parseInt('1101', 2) // 13 parseInt('0xfae3', 16) // 64227

In some JS implementations, parseInt parses leading zeros as octal:

Although discouraged by ECMAScript 3 and forbidden by ECMAScript 5, many implementations interpret a numeric string beginning with a leading 0 as octal. The following may have an octal result, or it may have a decimal result. Always specify a radix to avoid this unreliable behavior. — MDN

The fact that code gets clearer is a nice side effect of specifying the radix parameter.

Since parseFloat only parses numeric expressions in radix 10, there's no need for a radix parameter here.

More on this: