Skip to content
SPECIFICTION
Get listed

Chance.js vs Faker

Chance.js

chancejs.com

Faker

faker.readthedocs.io

Side by side

FigureChance.jsFaker
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
WebYes—
APIYes—
Self-hosted—Yes
Plans published11
Spec score · Test Data Generation Tools8.3 (#2)7.7 (#10)
Command lineThe site documents a CLI package, installed globally with `npm install -g chance-cli`, for invoking generators by name.Faker includes a command-line interface with locale selection, repeated output, output-file redirection, and custom-provider options.
Data typesIts generators cover items including text, people, locations, dates, finance, and web-related values.Built-in providers generate values such as names, addresses, and text.
LicenseChance is open source and released under the MIT License.Faker is released under the MIT License.
PurposeChance generates pseudo-random strings, numbers, and other values for automated tests and other uses that need random data.Faker is a Python package for generating fake data for database bootstrapping, XML documents, stress testing, and anonymizing production data.
Unique valuesThe `unique()` helper builds an array of non-repeating generated items of a requested length.The unique property can enforce uniqueness for an instance, but may raise UniquenessException when it cannot find another value.

Plans

Chance.js

  • Chance.jsFree

Chance.js pricing →

Faker

  • FakerFree

Faker pricing →

In their own words

Chance.js

Chance.js is a free, MIT-licensed JavaScript library for generating pseudorandom data used in automated tests and other applications needing sample values. Generators cover basic values, text, people, mobile identifiers, web data, locations, dates, finance, helpers, and miscellaneous categories. Developers can install it with npm for Node.js, load it in a browser, or use the separate chance-cli package from the command line. Browser users may create a global instance or instantiate several instances. Supplying a seed makes output repeatable; instances given the same seed can produce the same sequence. Integer generation accepts inclusive minimum and maximum bounds, and the unique() helper builds arrays without repeated generated items. The documented name generator supports English and Italian nationality options. The site lists chance.js at 95KB uncompressed and chance.min.js at 55KB, or 17KB gzipped. Chance is not intended for cryptographic applications requiring true randomness. The site credits Victor Quinn as its writer.

Visit chancejs.com

Faker

Faker has no write-up on Specifiction yet; its figures are above.

Visit faker.readthedocs.io