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 Javascript | by Max Headway | Medium
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
What is the advantage of using Number() instead of parseInt or parseFloat? More on sitepoint.com
🌐 sitepoint.com
1
May 30, 2023
javascript - What is the difference between Number.parseFloat() or parseFloat()? - Stack Overflow
This is still the case - and also bootstrap 5.0 uses Number.parseFloat, which fails for IE 11. 2021-10-01T07:36:34.85Z+00:00 ... Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... 1 In a JavaScript, should I call parseFloat to convert strings ... More on stackoverflow.com
🌐 stackoverflow.com
Difference parseInt() and parseFloat()
Nadia . is having issues with: Hi! Can anyone explain me the difference between parseInt and parseFloat? Like in what kind of situation should you use each of them? More on teamtreehouse.com
🌐 teamtreehouse.com
3
June 8, 2016
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
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Number › parseFloat
Number.parseFloat() - JavaScript - MDN Web Docs
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 - Both parseFloat and Number can produce numbers from typical strings that represent numbers, but both have some caveats which have to be handled regardless of which you choose, such as parsing non-numeric inputs (like booleans, objects, arrays), as well as atypical inputs (like octal numbers and whitespace).
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › parseFloat
parseFloat() - JavaScript - MDN Web Docs
It stops at the n character, and treats the preceding string as a normal integer, with possible loss of precision. If a BigInt value is passed to parseFloat(), it will be converted to a string, and the string will be parsed as a floating-point number, which may result in loss of precision as well.
🌐
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
Among its multitudinous features and functions, two generally used styles are parseFloat and parseInt, which hold considerable significance when it comes to handling numerical values within JavaScript. Starting with parseFloat, this system plays a pivotal part in converting strings to floating-point figures. The parseFloat function takes a string as input and returns a pier or NaN( not a number) if the conversion fails.
Find elsewhere
🌐
W3Schools
w3schools.com › jsref › jsref_parsefloat.asp
JavaScript parseFloat() Method
The parseFloat() method parses a value as a string and returns the first number.
🌐
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?
Top answer
1 of 5
452

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.

🌐
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.
🌐
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
May 3, 2018 - 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....
🌐
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.
🌐
TechOnTheNet
techonthenet.com › js › number_parsefloat.php
JavaScript: Number parseFloat() method
The string value to convert to a floating point number. The parseFloat() method parses a string and returns its value as a floating point number.
🌐
Quora
quora.com › What-is-the-difference-between-parseInt-and-parseFloat-in-JavaScript
What is the difference between parseInt() and parseFloat() in JavaScript? - Quora
Among its multitudinous features and functions, two generally used styles are parseFloat and parseInt, which hold considerable significance when it comes to handling numerical values within JavaScript. Starting with parseFloat, this system plays a pivotal part in converting strings to floating-point figures. The parseFloat function takes a string as input and returns a pier or NaN( not a number) if the conversion fails.
🌐
Zapier
community.zapier.com › home › learn and share › featured articles › javascript code: parsefloat vs parseint
JavaScript Code: parseFloat VS parseInt | Zapier Community
June 17, 2022 - How to handle numerical strings in JavaScript Code steps. parseInt() returns the first integer (w/ decimals) parseFloat() returns the first number (w/o decimals) NOTE: Input Data are all treated as strings.
🌐
GitHub
github.com › tc39 › proposal-numeric-separator › issues › 11
parseFloat alternative? · Issue #11 · tc39/proposal-numeric-separator
May 31, 2017 - I think there should be a way to extract 1_000 from "1_000 a" just like I can currently parseFloat('1000 a') === 1000. Something like Number.parse, with the semantics of "grab all characters that could possibly be a number literal, and then pass them into Number()", would address this concern - and would potentially be able to evolve just as freely as Number could.
Published   May 31, 2017
Author   ljharb