# is-plain-object

> Returns true if an object was created by the `Object` constructor, or Object.create(null).

Latest version **5.1.0** (published 2026-08-21) · MIT license · 0 weekly downloads

> **Better alternative:** Use v && typeof v === "object" && (Object.getPrototypeOf(v) === null || Object.getPrototypeOf(v) === Object.prototype) — Consider using a lighter alternative

## Install

```sh
npm install is-plain-object
pnpm add is-plain-object
yarn add is-plain-object
bun add is-plain-object
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.1.0 |
| Published | 2026-08-21 |
| First published | 2014-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 157 |
| Author | Jon Schlinkert |
| Maintainers | stevenvachon, trysound, jonschlinkert |
| Keywords | check, is, is-object, isobject, javascript, kind, kind-of, object, plain, type, typeof, value |

## Links

- npm: https://www.npmjs.com/package/is-plain-object
- Repository: https://github.com/jonschlinkert/is-plain-object
- Issues: https://github.com/jonschlinkert/is-plain-object/issues
- npm.io page: https://npm.io/package/is-plain-object

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 5.1.0 (latest) — 2026-08-21
- 5.0.0 — 2020-09-09
- 4.1.1 — 2020-07-24
- 4.1.0 — 2020-07-21
- 4.0.0 — 2020-07-21
- 3.0.1 — 2020-06-27
- 3.0.0 — 2019-04-30
- 2.0.4 — 2017-07-11
- 2.0.3 — 2017-05-30
- 2.0.2 — 2017-05-27
- 2.0.1 — 2015-05-28
- 2.0.0 — 2015-04-29
- 1.0.0 — 2015-02-25
- 0.1.0 — 2014-09-21

## README

# is-plain-object

[![npm version](https://img.shields.io/npm/v/is-plain-object.svg)](https://www.npmjs.com/package/is-plain-object)
[![npm downloads](https://img.shields.io/npm/dm/is-plain-object.svg)](https://www.npmjs.com/package/is-plain-object)
[![CI](https://github.com/jonschlinkert/is-plain-object/actions/workflows/ci.yml/badge.svg)](https://github.com/jonschlinkert/is-plain-object/actions/workflows/ci.yml)

> Returns `true` if an object was created by the `Object` constructor or with a `null` prototype.

Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and starring the project to show your ❤️ and support.

Use [isobject](https://github.com/jonschlinkert/isobject) if you only want to check whether a value is an object and not an array or `null`.

## Install

```sh
npm install is-plain-object
```

## Usage

With ES modules:

```js
import { isPlainObject } from 'is-plain-object';

isPlainObject({});                        // true
isPlainObject({ foo: 'bar' });            // true
isPlainObject(Object.create(null));       // true
isPlainObject(Object.create({}));         // true

isPlainObject();                          // false
isPlainObject(null);                      // false
isPlainObject([]);                        // false
isPlainObject(new Date());                // false
isPlainObject(/foo/);                     // false
isPlainObject(() => {});                  // false
```

With CommonJS:

```js
const { isPlainObject } = require('is-plain-object');
```

## API

### `isPlainObject(value)`

Returns `true` when `value` is a plain object. Objects created by the `Object` constructor and objects with a `null` prototype are considered plain.

## Development

Install dependencies, build the CommonJS and ES module bundles, and run the tests:

```sh
npm install
npm run build
npm test
```

## Related projects

- [is-number](https://www.npmjs.com/package/is-number): Check if a value is a finite number.
- [isobject](https://www.npmjs.com/package/isobject): Check if a value is an object and not an array or `null`.
- [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value.

## License

[MIT](LICENSE) © Jon Schlinkert

---
_Source: https://npm.io/package/is-plain-object · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
