The internal workings are not that different, as @James Allardic already answered. There is a difference though. Using parseFloat, a (trimmed) string starting with one or more numeric characters followed by alphanumeric characters can convert to a Number, with Number that will not succeed. As in:

parseFloat('3.23abc'); //=> 3.23
Number('3.23abc'); //=> NaN

In both conversions, the input string is trimmed, by the way:

parseFloat('  3.23abc '); //=> 3.23
Number('   3.23 '); //=> 3.23
Answer from KooiInc on Stack Overflow
Top answer
1 of 5
68

The internal workings are not that different, as @James Allardic already answered. There is a difference though. Using parseFloat, a (trimmed) string starting with one or more numeric characters followed by alphanumeric characters can convert to a Number, with Number that will not succeed. As in:

parseFloat('3.23abc'); //=> 3.23
Number('3.23abc'); //=> NaN

In both conversions, the input string is trimmed, by the way:

parseFloat('  3.23abc '); //=> 3.23
Number('   3.23 '); //=> 3.23
2 of 5
33

No. Both will result in the internal ToNumber(string) function being called.

From ES5 section 15.7.1 (The Number Constructor Called as a Function):

When Number is called as a function rather than as a constructor, it performs a type conversion...

Returns a Number value (not a Number object) computed by ToNumber(value) if value was supplied, else returns +0.

From ES5 section 15.1.2.3 (parseFloat (string)):

... If neither trimmedString nor any prefix of trimmedString satisfies the syntax of a StrDecimalLiteral (see 9.3.1) ...

And 9.3.1 is the section titled "ToNumber Applied to the String Type", which is what the first quote is referring to when it says ToNumber(value).


Update (see comments)

By calling the Number constructor with the new operator, you will get an instance of the Number object, rather than a numeric literal. For example:

typeof new Number(10); //object
typeof Number(10); //number

This is defined in section 15.7.2 (The Number Constructor):

When Number is called as part of a new expression it is a constructor: it initialises the newly created object.

🌐
Medium
medium.com › @maxheadway › the-differences-between-number-and-parsefloat-in-javascript-8ee74b961ed4
The differences between Number() and parseFloat() in ...
February 19, 2023 - Handling of Non-numeric Characters: parseFloat stops parsing the input string and returns the numeric value parsed up to that point if it encounters a non-numeric character. Number returns NaN if it encounters a non-numeric character.
Discussions

The advantage of using Number() instead of parseInt or parseFloat - JavaScript - SitePoint Forums | Web Development & Design Community
One somewhat nice thing is that you can shorthand Numbers, because Javascript defaults to using Number when doing unspecified string to numbertype conversions: More on sitepoint.com
🌐 sitepoint.com
1
May 30, 2023
javascript - What is the difference between Number.parseFloat() or parseFloat()? - Stack Overflow
1 In a JavaScript, should I call parseFloat to convert strings to floating point numbers, or should I let JavaScript convert them? More on stackoverflow.com
🌐 stackoverflow.com
parseFloat alternative?
It's quite obvious that parseFloat can't suddenly start parsing _, as it would likely break the web. However, parsing floats from a string is still a valid use case - and a separate one fro... More on github.com
🌐 github.com
42
May 31, 2017
Best ways to convert a string to number in Javascript
I'd rather go with Number() Number("010") // 10 ; parseInt("010") // 8 ; implicit octal parseInt("010", 10) // 10, decimal radix used https://stackoverflow.com/questions/4090518/what-is-the-difference-between-parseint-and-number More on reddit.com
🌐 r/learnjavascript
4
6
May 21, 2020
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Number › parseFloat
Number.parseFloat() - JavaScript - MDN Web Docs
July 10, 2025 - The Number.parseFloat() static method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns NaN.
🌐
Camchenry
camchenry.com › blog › parsefloat-vs-number
parseFloat vs Number: What's the Difference? | Cam McHenry
June 23, 2021 - At a glance, both parseFloat and the Number constructor generally do the same thing.
🌐
SitePoint
sitepoint.com › javascript
The advantage of using Number() instead of parseInt or parseFloat - JavaScript - SitePoint Forums | Web Development & Design Community
May 30, 2023 - Number can interpret a value in scientific notation (“7e2” = 700), but will NaN anything that isnt actually a number format (“80px” = NaN), whereas parseInt just reads characters until it finds a non-digit and stops.
🌐
W3Schools
w3schools.com › jsref › jsref_parsefloat.asp
JavaScript parseFloat() Method
The parseFloat() method parses a value as a string and returns the first number.
🌐
Alibaba Cloud
topic.alibabacloud.com › a › the-difference-between-number--parseint--and-parsefloat--in-js_1_11_30521894.html
The difference between number (), parseint (), and parsefloat () in JS
In other words, the first decimal ... to specify the usage of the radix If the string contains a number that can be parsed as a positive number (no decimal point, or zero after the decimal point), parseFloat() will return an integer....
Find elsewhere
🌐
Quora
quora.com › What-is-the-difference-in-Javascript-between-Number-parseFloat-and-String-*1
What is the difference in Javascript between Number(), parseFloat(), and {String}*1? - Quora
Answer (1 of 2): Number() and parseFloat() are very different in what they do. and while they could be expected to accomplish the same things, there is still some edge differences in what they produce that developers should really be aware of. Overview As a short summary, you can consider in my...
Top answer
1 of 5
454

The difference between parseFloat and Number

parseFloat()/parseInt() is for parsing a string, while Number()/+ is for coercing a value to a number. They behave differently. But first let's look at where they behave the same:

parseFloat('3'); // => 3
Number('3'); // => 3
parseFloat('1.501'); // => 1.501
Number('1.501'); // => 1.501
parseFloat('1e10'); // => 10000000000
Number('1e10'); // => 10000000000

So as long as you have standard numeric input, there's no difference. However, if your input starts with a number and then contains other characters, parseFloat truncates the number out of the string, while Number gives NaN (not a number):

parseFloat('1x'); // => 1
Number('1x'); // => NaN

In addition, Number understands hexadecimal input while parseFloat does not:

parseFloat('0x10'); // => 0
Number('0x10'); // => 16

But Number acts weird with empty strings or strings containing only white space:

parseFloat(''); // => NaN
Number(''); // => 0
parseFloat(' \r\n\t'); // => NaN
Number(' \r\n\t'); // => 0

On the whole, I find Number to be more reasonable, so I almost always use Number personally (and you'll find that a lot of the internal JavaScript functions use Number as well). If someone types '1x' I prefer to show an error rather than treat it as if they had typed '1'. The only time I really make an exception is when I am converting a style to a number, in which case parseFloat is helpful because styles come in a form like '3px', in which case I want to drop the 'px' part and just get the 3, so I find parseFloat helpful here. But really which one you choose is up to you and which forms of input you want to accept.

Note that using the unary + operator is exactly the same as using Number as a function:

Number('0x10'); // => 16
+'0x10'; // => 16
Number('10x'); // => NaN
+'10x'; // => NaN
Number('40'); // => 40
+'40'; // => 40

So I usually just use + for short. As long as you know what it does, I find it easy to read.

2 of 5
19

In these examples you can see the difference:

Number('') = 0;
Number(false) = 0;
Number('1a') = NaN;

parseFloat('') = NaN;
parseFloat(false) = NaN;
parseFloat('1a') = 1;

parseFloat is a bit slower because it searches for first appearance of a number in a string, while the Number constuctor creates a new number instance from strings that contains numeric values with whitespace or that contains falsy values.

🌐
MeasureThat
measurethat.net › Benchmarks › Show › 555 › 0 › number-vs-vs-parsefloat
Benchmark: Number vs + vs parseFloat - MeasureThat.net
Number vs + vs parseFloat 23 · Number vs + vs parseFloat 235 · Implicit vs parseFloat vs Number string to num · Number vs + vs parseFloat + properties px · Number vs + vs parseFloat v2 · Comments · Do you really want to delete benchmark?
🌐
MSR
rajamsr.com › home › javascript parsefloat(): how to avoid common mistakes
JavaScript ParseFloat(): How to Avoid Common Mistakes | MSR - Web Dev Simplified
January 28, 2024 - If a valid number is found, then it converts it to a floating-point integer. The parseFloat() function in JavaScript returns NaN if the string does not contain a valid number.
🌐
GitHub
github.com › tc39 › proposal-numeric-separator › issues › 11
parseFloat alternative? · Issue #11 · tc39/proposal-numeric-separator
May 31, 2017 - It's quite obvious that parseFloat can't suddenly start parsing _, as it would likely break the web. However, parsing floats from a string is still a valid use case - and a separate one from "cast this string to a Number". I think there ...
Author: tc39
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › parseFloat
parseFloat() - JavaScript - MDN Web Docs
July 8, 2025 - The parseFloat function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or NaN.
🌐
Quora
quora.com › What-is-the-difference-between-parseInt-and-parseFloat-in-JavaScript
What is the difference between parseInt() and parseFloat() in JavaScript? - Quora
Answer (1 of 4): In short answer, with [code ]parseInt()[/code] you can parses a string into Integer Number, and with [code ]parseFloat()[/code] you can parses a string into Floating Number. In detail answer is : 1. [code ]parseInt()[/code] [code ]parseInt()[/code] has 2 parameters you have to...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-number-parsefloat-method
JavaScript Number parseFloat() Method - GeeksforGeeks
July 11, 2025 - JavaScript parseFloat() Method is used to accept the string and convert it into a floating-point number. If the string does not contain a numeral value or If the first character of the string is not a Number then it returns NaN i.e, not a number.
🌐
The Valley of Code
thevalleyofcode.com › javascript-number-parsefloat
The Number parseFloat() method
March 17, 2019 - Number.parseFloat('10') //10 Number.parseFloat('10.00') //10 Number.parseFloat('237,21') //237 Number.parseFloat('237.21') //237.21 Number.parseFloat('12 34 56') //12 Number.parseFloat(' 36 ') //36 Number.parseFloat('36 is my age') //36 Number.parseFloat('-10') //-10 Number.parseFloat('-10.2') //-10.2
🌐
Copahost
copahost.com › home › javascript parsefloat: examples and variations of this function
Javascript parseFloat: Examples and variations of this function - Copahost
July 16, 2023 - We have to remember that if the first character of the string passed in the parseFloat method is not a number, the result will be NaN. The parseFloat method in javascript can also be used with decimals. We can pass a string containing a decimal number and get the corresponding floating-point number.
🌐
Medium
medium.com › @emreavcilar › javascript-parseint-vs-number-8186ef8e29c1
JavaScript: parseInt() vs Number() | by Emre Avcılar
September 11, 2023 - function benchmark(name, cb) { const t0 = performance.now() for (let i = 0; i < 15e7; i++) { cb(); } const t1 = performance.now() console.log(`${name} took ${t1 - t0} ms`); } const process1 = () => Number('9.9'); // 9.9 const process2 = () => parseInt('9.9', 10); // 9 const process3 = () => Number('12'); // 12 const process4 = () => parseFloat('12'); // 12 benchmark('process1', process1); // 94.5 ms benchmark('process2', process2); // 651.59 ms benchmark('process3', process3); // 656.5 ms benchmark('process4', process4); // 798.29 ms ·