The only difference is this:

!isNan(1/0) // --> true
isFinite(1/0) // --> false

isNaN checks whether the argument is a number or not. The Infinities (+/-) are also numerical, thus they pass the isNaN check, but don't pass the isFinite check.

** Note that any string which can be parsed as a number ("2", "3.14") will cause isNaN to return false.

Hope this helps.

PS: The answer given by user1170379 was very nearly perfect.

Answer from kumarharsh on Stack Overflow
🌐
DEV Community
dev.to › kobbyowen › javascript-in-depth-isfinite-isnan-functions-cp6
JavaScript In Depth - isFinite & IsNaN Functions - DEV Community
November 1, 2021 - This behavior is so true that, ECMAScript documentation suggests that one of the reliable ways to check for NaN is the expression(x === x), which returns false only if x is a NaN. Mostly, to determine if a number is okay to be used in arithmetic operation without few surprises, you should find yourself using isFinite more than isNaN, since isFinite checks for NaN values and goes on to check for infinite values.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › isFinite
isFinite() - JavaScript - MDN Web Docs - Mozilla
July 8, 2025 - When the argument to the isFinite() function is not of type Number, the value is first coerced to a number, and the resulting value is then compared against NaN and ±Infinity. This is as confusing as the behavior of isNaN — for example, isFinite("1") is true.
🌐
Alibaba Cloud
topic.alibabacloud.com › a › the-difference-between-isnan--and-isfinite--in-javascript_1_24_30320235.html
The difference between isNaN () and Isfinite () in JavaScript
Isfinite (number) is a JavaScript built-in function that determines whether a number object can be converted to a finite digit. The IsNaN NaN property is a special value that represents a non-numeric value.
🌐
MathWorks
mathworks.com › matlab › mathematics › elementary math › constants and test matrices
isfinite - Determine which array elements are finite - MATLAB
TF = isfinite(A) returns a logical array containing 1 (true) where the elements of the array A are finite, and 0 (false) where they are infinite or NaN.
🌐
Julia Programming Language
discourse.julialang.org › new to julia
Bugs in isfinite(), isnan and isinf()? - New to Julia - Julia Programming Language
February 10, 2021 - the following seems to be bugs to me: julia> isfinite.([NaN, Inf, 2.0, -Inf]) 4-element BitArray{1}: 1 1 1 1 julia> isinf.([NaN, Inf, 2.0, -Inf]) 4-element BitArray{1}: 0 0 0 0 julia> isnan.([NaN, Inf, 2.0, -I…
🌐
GitHub
github.com › 30-seconds › 30-seconds-of-code › issues › 41
Validate number: use only isFinite? · Issue #41 · Chalarangelo/30-seconds-of-code
December 12, 2017 - Use !isNaN in combination with parseFloat() to check if the argument is a number. Use isFinite() to check if the number is finite.
Author   Chalarangelo
🌐
TutorialsPoint
tutorialspoint.com › article › javascript-how-to-check-if-a-number-is-nan-or-finite
JavaScript: How to check if a number is NaN or finite?
March 7, 2025 - // Number.isNaN() doesn't convert ...(Number.isNaN(0/0)); // true (actual NaN) ... The isFinite() function converts non-numeric values to numbers before checking if they are finite....
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.isfinite.html
numpy.isfinite — NumPy v2.5 Manual
isinf, isneginf, isposinf, isnan · Notes · Not a Number, positive infinity and negative infinity are considered to be non-finite. NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic (IEEE 754). This means that Not a Number is not equivalent to infinity.
Find elsewhere
🌐
CodeKraft
abdulapopoola.com › 2017 › 10 › 23 › why-you-should-not-use-isnan
Why you should not use isNaN in JavaScript – CodeKraft
August 20, 2021 - You should switch to Number.isNaN which is already supported by all major browsers except IE11 and also add a polyfill fallback (just in case). You should also know that isFinite uses isNaN internally and consequently suffers the same flaws.
🌐
W3Schools
w3schools.com › Jsref › jsref_isfinite_number.asp
JavaScript Number.isFinite() Method
The Global isFinite() Method · The Global isNaN() Method · The Number.isNaN() Method · The POSITIVE_INFINITY Property · The NEGATIVE_INFINITY Property · isFinite() returns true if a value is a finite number.
🌐
Code.mu
code.mu › en › javascript › manual › lang › isFinite
The isFinite function - a number checking in JavaScript
The result of parseFloat is then processed with !isNaN to get true or false instead of NaN. As a result, everything is filtered out, except for strings-numbers and ordinary numbers. isFinite(value); Now isFinite will output true since the parameter is a number: let num = 3; console.log(isF...
🌐
cppreference.com
en.cppreference.com › c › numeric › math › isfinite
isfinite - cppreference.com
isfinite(NAN) = 0 isfinite(INFINITY) = 0 isfinite(0.0) = 1 isfinite(DBL_MIN/2.0) = 1 isfinite(1.0) = 1 isfinite(exp(800)) = 0
🌐
Boost
boost.org › doc › libs › 1_41_0 › libs › math › doc › sf_and_dist › html › math_toolkit › utils › fpclass.html
Floating-Point Classification: Infinities and NaN's - 1.41.0
#define FP_ZERO /* implementation ... T> int fpclassify(T t); template <class T> bool isfinite(T z); // Neither infinity nor NaN. template <class T> bool isinf(T t); // Infinity (+ or -). template <class T> bool isnan(T t); // NaN....
🌐
Vultr Docs
docs.vultr.com › javascript › global › isFinite
JavaScript isFinite() - Check If Finite Number | Vultr Docs
December 9, 2024 - In this article, you will learn how to leverage the isFinite() function in JavaScript. Get familiar with its basic usage, understand how it can be applied in different scenarios, and see how it differs from other similar functions like isNaN() or when using type coercion.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-check-whether-a-number-is-nan-or-finite-in-javascript
How to check whether a number is NaN or finite in JavaScript ? - GeeksforGeeks
September 16, 2024 - Note: For a more reliable check ... NaN and not just something that can't be coerced into a number. The isFinite() function checks if a number is finite. A finite number is one that is not Infinity, -Infinity, or ...
🌐
Luau RFCs
rfcs.luau.org › math-isnan-isfinite-isinf.html
math.isnan, math.isinf and math.isfinite for Math Library | Luau RFCs
local x = 0 / 0 -- produces NaN local y = 10 print(math.isnan(x)) -- true print(math.isnan(y)) -- false ... Returns true if x is positive or negative infinity (Inf), and false otherwise. ... local x = math.huge local y = 10 print(math.isinf(x)) -- true print(math.isinf(y)) -- false print(math.isinf(0 / 0)) -- false (NaN) ... Returns true if x is a finite number, meaning it is neither NaN nor positive or negative infinity (math.huge). ... local x = math.huge local y = 0 / 0 local z = 123.45 print(math.isfinite(x)) -- false print(math.isfinite(y)) -- false print(math.isfinite(z)) -- true
🌐
Jsperf
jsperf.com › isnan-vs-isfinite-vs › 2
isNaN vs isFinite vs ParseInt vs Number · jsPerf
Revision 2 of this test case created by on 2013-4-17 · Warning! For accurate results, please disable Firebug before running the tests. (Why?)
🌐
John Kavanagh
johnkavanagh.co.uk › home › articles › number.isnan(), number.isfinite(), and number.isinteger() in javascript
Number.isNaN(), Number.isFinite(), Number.isInteger() | John Kavanagh
May 14, 2026 - Number.isNaN() Number.isFinite() Number.isInteger() These are small additions, but they make numeric checks much less slippery. NaN stands for "Not a Number", but it is still of type number. That already sounds slightly ridiculous, which is probably why it confuses people so reliably.
🌐
Studytonight
studytonight.com › post › python-math-functions-isinf-isfinite-and-isnan
Python Math functions - isinf(), isfinite(), and isnan() - Studytonight
November 1, 2019 - This article covers python math module functions like python isinf() function, python isfinite() function, python isnan() function with code examples.