From the MDN page about the behaviour of the typeof operator:

null

// This stands since the beginning of JavaScript
typeof null === 'object';

In the first implementation of JavaScript, JavaScript values were represented as a type tag and a value. The type tag for objects was 0. null was represented as the NULL pointer (0x00 in most platforms). Consequently, null had 0 as type tag, hence the "object" typeof return value. (reference)

A fix was proposed for ECMAScript (via an opt-in), but was rejected. It would have resulted in typeof null === 'null'.

Answer from Deepak Ingole on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Operators › typeof
typeof - JavaScript - MDN Web Docs - Mozilla
4 weeks ago - js · // This stands since the beginning of JavaScript typeof null === "object"; In the first implementation of JavaScript, JavaScript values were represented as a type tag and a value. The type tag for objects was 0. null was represented as the NULL pointer (0x00 in most platforms).
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Operators › null
null - JavaScript - MDN Web Docs
When checking for null or undefined, beware of the differences between equality (==) and identity (===) operators, as the former performs type-conversion. ... typeof null; // "object" (not "null" for legacy reasons) typeof undefined; // "undefined" null === undefined; // false null == undefined; // true null === null; // true null == null; // true !null; // true Number.isNaN(1 + null); // false Number.isNaN(1 + undefined); // true
🌐
DEV Community
dev.to › m0slah › why-typeof-null-object-in-javascript-a-deep-dive-into-a-quirky-bug-n6p
Why typeof null === "object" in JavaScript? A Deep Dive into a Quirky Bug - DEV Community
May 17, 2025 - The type tag for objects was 000, and null also happened to be represented with a binary value of all zeroes (0x00). As a result, the typeof operation interpreted null as an object.
🌐
Reddit
reddit.com › r/javascript › why is `typeof null === 'object'` in javascript? the 30-year story of a bug we can't fix
r/javascript on Reddit: Why is `typeof null === 'object'` in JavaScript? The 30-year story of a bug we can't fix
October 14, 2025 - See his comment in https://2ality.com/2013/10/typeof-null.html ... Your ad blocker is culling Disqus. ... It's a bug in the sense that it's unwanted, it's not a bug in the sense that is now part of the spec. Pick your definition. ... AFAIK, it was needed for null pointer exception compatibility with Java, so yeah it's not a bug in JS, it's a bug in strongly typed languages like Java or Go.
🌐
Reddit
reddit.com › r/learnjavascript › "typeof" null an object?
r/learnjavascript on Reddit: "typeof" null an object?
November 26, 2022 -

We know that the "typeof" null in javascript is an object, and we also know that it's a bug in JavaScript. I wanted to know what kind of bug it is, and why anyone hasn't resolved it yet.

🌐
DEV Community
dev.to › elmarshall › javascript-typeof-null-52k0
JavaScript: typeof null - DEV Community
May 29, 2020 - Based on what I've said above, you would likely expect to see null, true. typeof returns the value type, and === strictly evaluates equality.
🌐
JavaScript in Plain English
javascript.plainenglish.io › there-is-a-bug-in-javascript-since-day-one-typeof-null-9b18da349cc6
There is a BUG in JavaScript Since Day One — ‘typeof null’ | by Omer Aslan | JavaScript in Plain English
January 9, 2022 - Values were kept in 32 bit units ... type tags(1–3 bits)+ value (29–31 bits)= total 32 bits ... null (JSVAL_NULL) was the machine code NULL pointer....
Find elsewhere
🌐
GitHub
github.com › rohan-paul › Awesome-JavaScript-Interviews › blob › master › Javascript › Tricky-JS-Problems › typeof-null-why-its-object.md
Awesome-JavaScript-Interviews/Javascript/Tricky-JS-Problems/typeof-null-why-its-object.md at master · rohan-paul/Awesome-JavaScript-Interviews
In the first implementation of JavaScript, JavaScript values were represented as a type tag and a value. The type tag for objects was 0. null was represented as the NULL pointer (0x00 in most platforms). Consequently, null had 0 as type tag, ...
Author   rohan-paul
🌐
JavaScript in Plain English
javascript.plainenglish.io › guess-what-typeof-null-returns-in-javascript-90cb86d2379d
What does “typeof null” return in JavaScript? | by Mohith Gupta | JavaScript in Plain English
November 20, 2023 - However, there were no pointers in JavaScript like C. So null meant nothing, just a void, and ended up with the representation of all 0’s. All of its 32 bits were 0’s. So whenever the JavaScript interpreter reads null, it considers the first 3 bits as 000 which is the same as that of an object · That is the reason why typeof null returns “object”
🌐
Medium
medium.com › hacktive-devs › null-is-not-an-object-8faa6d8d0257
Null is not an Object
February 21, 2020 - In JavaScript, typeof null returns ‘object’. Then you start to wonder “why?”, since null means “nothing”. As a developer, my instinct has always been “Well, everything is an object in JS” until I got to think, well, not everything is an object as we have primitive data types in Javascript.
🌐
Medium
medium.com › @AlexanderObregon › the-real-reason-javascript-typeof-null-returns-object-f41d39c9fe5b
The Real Reason JavaScript typeof Null Returns Object | by Alexander Obregon | Medium
June 3, 2025 - The typeof operator can catch people off guard, especially when you're trying to check what kind of value you're dealing with and get back something unexpected. Most of the time, it gives a helpful answer. If you're working with a number, it says "number". If it's a string, you get "string". That pattern works well until you hit null.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › null
null - JavaScript | MDN
May 23, 2022 - When checking for null or undefined, beware of the differences between equality (==) and identity (===) operators, as the former performs type-conversion. ... typeof null; // "object" (not "null" for legacy reasons) typeof undefined; // "undefined" null === undefined; // false null == undefined; // true null === null; // true null == null; // true !null; // true Number.isNaN(1 + null); // false Number.isNaN(1 + undefined); // true
🌐
Piotr Zarycki
pzarycki.com › posts › why typeof null === object
Why typeof null === object | Piotr Zarycki - Programming Blog
September 27, 2025 - Because null is represented as 0x00000000, and the three lowest bits are 000, the JSVAL_IS_OBJECT macro considers null to be an object! Was it possible to fix this? - of course! As we can notice, the null representation is simply 0, a non-existent location in memory, and an object is something that exists, and horror of horrors, the macro that correctly checked for null was in the code, but was not used in the typeof function!
🌐
Dmitri Pavlutin
dmitripavlutin.com › javascript-null
Everything about null in JavaScript - Dmitri Pavlutin
September 21, 2020 - The strict equality operator determines ... (number, string, boolean). However, typeof is misleading in case of null: typeof null evaluates to 'object'....
🌐
Alexanderell
alexanderell.is › posts › typeof-null
typeof null: investigating a classic JavaScript bug · Caffeinspiration
This is where we have the problem! We then compare null’s calculated 0x0 tag with JSVAL_OBJECT, 0x0. They match! This means our JS_TypeOfValue call then checks if its a function, and when it isn’t, it assigns type to be JSTYPE_OBJECT and returns type.
🌐
Sololearn
sololearn.com › en › Discuss › 3314273 › why-does-typeof-null-show-object-in-javascript
Why does typeof null show 'object' in JavaScript? | Sololearn: Learn to code for FREE!
It is actually a historical bug from days of old when javascript was first assigning the typeof to data types and null was assigned as an object. The original creators chose not to " fix it " verses saying undefined or NAN. It has remained as is ...
🌐
Medium
medium.com › @seema.workforce › what-is-the-typeof-null-d288e2da6557
what is the typeof null?
November 8, 2024 - When the language was first being developed, null was stored as a special value with a type tag of 0 (which was used for objects). So, when typeof was implemented, it mistakenly identified null as an object.
🌐
Esdiscuss
esdiscuss.org › topic › typeof-null
typeof null
The issue isn't typeof null. null === is a more convenient test. The issue is that typeof object gives a false positive when the value is null. So sensing that a value is an object is error prone. We need a simple, reliable test for objectness. ... +1 this is something even seasoned js developers routinely trip over.
🌐
bitsofcode
bitsofco.de › javascript-typeof
"What's the typeof null?", and other confusing JavaScript Types | bitsofcode
February 21, 2017 - What is the type of a typeof expression? Well, the typeof operator always returns a string with the type of the operand passed to it. If the resultant type of the expression is, for example, a number, what will be returned is "number".