Need A Lot Of Fake Data, Real Quick?

Say no more, for faker.js has you covered!

Faker.js is fake data generator implemented for nodejs and the browser. From zip codes to avatars to account names to hacker phrases, faker.js comes equipped with a huge dataset.

Use In The Browser

<!-- Just link to faker.js in your html through their CDN -->
<script src=""></script>
<!-- or your local download -->
<script src=”/path/to/faker.js”></script>


Install the dependency into your directory:

npm install -S faker

Then create an index.js and inside require faker:

const faker = require(‘faker’);

API Service

Faker even has a hosted API you can make http requests to for random data. Here's how you can make a http request for data using the fetch method in javascript:


and using curl:


How To Use

Once you have faker installed, you will have access to the faker object. This object is filled with subcategories of data (address, company, database, date, hacker, image, internet, name, phone, random…).

Each subcategory has a set of methods that, when called, will return some data based on method called.


Input (nodejs)

You can even change the localization by changing faker.locale (the default is english)

faker.local = “fr”; // language is set to French

faker.local = "es"; // language is set to Spanish


Receiving from the API is just as easy!

Ajax example:

ajax output

Curl Example:


Additional Features

You can seed results by using faker.seed.

You can use faker.fake for combining different methods.

Like what you read? Give Cain Watson a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.