faker-js /faker

Generate massive amounts of fake data in the browser and node.js

★ 15,550⑂ 1,156👁 32⑃ 3,270● 836▤ 63
TypeScriptNOASSERTIONCreated 2022-01-07fakerjs.dev
Download: v10.6.0v10.6.0 ↓10.6.02026-08-14
-2
Daily
15,550
stars
1,156
forks
32
watchers
3,270
prs
836
issues
63
releases

README

Faker
  Generate massive amounts of fake (but realistic) data for testing and development.










 ⚡️ Try it Online

Open in StackBlitz

 📙 API Documentation

⚠️ You are reading the docs for the next branch ⚠️

Please proceed to the Getting Started Guide for the stable release of Faker.

For detailed API documentation, please select the version of the documentation you are looking for.

|   Version    | Website                   |
| :----------: | :------------------------ |
|  v11 (next)  | https://next.fakerjs.dev/ |
| v10 (stable) | https://fakerjs.dev/      |
|   v9 (old)   | https://v9.fakerjs.dev/   |

---

 🚀 Features

- 🧍 Person - Generate Names, Genders, Bios, Job titles, and more.
- 📍 Location - Generate Addresses, Zip Codes, Street Names, States, and Countries!
- ⏰ Date - Past, present, future, recent, soon... whenever!
- 💸 Finance - Create stubbed out Account Details, Transactions, and Crypto Addresses.
- 👠 Commerce - Generate Prices, Product Names, Adjectives, and Descriptions.
- 👾 Hacker - “Try to reboot the SQL bus, maybe it will bypass the virtual application!”
- 🔢 Number and String - Of course, we can also generate random numbers and strings.
- 🌏 Localization - Pick from over 70 locales to generate realistic looking Names, Addresses, and Phone Numbers.

 Note: Faker tries to generate realistic data and not obvious fake data.
 The generated names, addresses, emails, phone numbers, and/or other data might be coincidentally valid information.
 Please do not send any of your messages/calls to them from your test setup.

 📦 Install

bash
npm install --save-dev @faker-js/faker


 🪄 Usage

There are two ways to use Faker:

- Standalone (Made for small bundle sizes, since v11.0)
- Tree (Everything accessible via singular import)

 Standalone Function Usage

ts
import { ... } from '@faker-js/faker';

const fakerCore = createFakerCore({ locale: [en_US, en, base] });

export function fakeUser(fakerCore: FakerCore) {
  return {
    userId: fakeStringUuid(fakerCore),
    username: fakeInternetUsername(fakerCore),
    email: fakeInternetEmail(fakerCore),
    avatar: fakeImageAvatar(fakerCore),
    password: fakeInternetPassword(fakerCore),
    birthdate: fakeDateBirthdate(fakerCore),
    registeredAt: fakeDatePast(fakerCore),
  };
}

export const users = fakeHelpersMultiple(fakerCore, fakeUser, {
  count: 5,
});


 Function Tree Usage

ts
// ESM
import { faker } from '@faker-js/faker';

// CJS
const { faker } = require('@faker-js/faker');

export function createRandomUser() {
  return {
    userId: faker.string.uuid(),
    username: faker.internet.username(),
    email: faker.internet.email(),
    avatar: faker.image.avatar(),
    password: faker.internet.password(),
    birthdate: faker.date.birthdate(),
    registeredAt: faker.date.past(),
  };
}

export const users = faker.helpers.multiple(createRandomUser, {
  count: 5,
});


 💎 Modules

An in-depth overview of the API methods is available in the documentation for v10 (stable) and v11 (

Top issues

Discussions

Latest release

v10.6.0 v10.6.0 2026-08-14
What's Changed
 fix(locale): exclude forbidden letter combinations from nl postcodes by @chatman-media in https://github.com/faker-js/faker/pull/3888
 feat(locale): add Norwegian (nb_NO) animal module by @arvindfroi in https://github.com/faker-js/faker/pull/3901
 feat(locale): add Norwegian (nb_NO) food module by @arvindfroi in https://github.com/faker-js/faker/pull/3900
 fix(locale): only generate valid French postal codes by @MahinAnowar in https://github.com/faker-js/faker/pull/3905
 feat(phone): mobile styles for more locales by @matthewmayer in https://github.com/faker-js/faker/pull/

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON