faker-js /faker
Generate massive amounts of fake data in the browser and node.js
★ 15,550⑂ 1,156👁 32⑃ 3,270● 836▤ 63
-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
#768Reimplement internet.password() with more generation options21 comments · 2022-04-03#1094Follow Benford's law for finance amounts.17 comments · 2022-06-20#1154Random bundle id15 comments · 2022-07-14#558Random greek alphabet letter15 comments · 2022-02-24#181Credit Card number parameter15 comments · 2022-01-16#2103Building number returns incorrect data for PL14 comments · 2023-04-27#2402Add Greetings13 comments · 2023-09-17#953Provide some cloud functions/modules13 comments · 2022-05-14
Discussions
#4031Is it possible if the Faker Library supports Test Data in Thai ?1 comments · 2026-09-03#3793add support for Temporal entities1 comments · 2026-04-07#3791add to SimpleFaker class constructor optional defaultRefDate (like seed)1 comments · 2026-04-06#3746Suggestions: Switch to The Small Business License (SBL)6 comments · 2026-02-27#3695Faker organization has a serious OPSEC risk problem - Marak 2.0?3 comments · 2026-01-10#3676why is slugify not converting to lowercase1 comments · 2025-12-18#3663How to remove built-in regex characters in the output of "fromRegExp"1 comments · 2025-11-26#3611Document translation to Spanish1 comments · 2025-09-11
Latest release
v10.6.0 v10.6.0 2026-08-14What'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/