Datafaker
Datafaker is a free, self-hosted library for Java, Kotlin, and Groovy projects that generates synthetic data.
What Datafaker is
Datafaker is a free, self-hosted library for Java, Kotlin, and Groovy projects that generates synthetic data. It is intended for test databases, stress testing, anonymizing production data, and supplying sample content for a project showcase. The site lists 263 providers across base, entertainment, food, healthcare, sport, and videogame categories, with more than 250 providers highlighted on the homepage. Developers can write custom providers in code or load provider data from YAML files, which may help with larger data sets. Fake collections and streams support configurable sequence lengths and null rates. Expressions can produce letters, digits, regular-expression output, CSV, or JSON. Documented formats include CSV, JSON, SQL, YAML, XML, Java Object, and TOML; XML functionality is deprecated. Version 2.7.0 adds an HTTP faker for status codes, headers, and user agents. Datafaker 2.x targets Java 17, while the older Java 8-based 1.x line is unmaintained. Maven Central hosts the Apache 2.0-licensed library.
Good
- Free Apache 2.0-licensed library
- 263 listed providers across many categories
- Custom providers support code and YAML
- Generates CSV, JSON, SQL, and more
- Supports fake collections and streams
Watch out
- Datafaker 2.x requires Java 17
- Datafaker 1.x is no longer maintained
- XML functionality is deprecated
- Weighted selection is limited to custom hardcoded providers
Who it suits
Datafaker suits developers building Java, Kotlin, or Groovy applications that need generated data for testing, anonymization, or demonstrations. It also fits teams running self-hosted tooling and creating custom providers.
Verdict
Datafaker provides broad synthetic-data generation for JVM projects, with many providers and several customization paths. Check Java requirements and the deprecated XML functionality before adopting it.
The facts
Each one read from Datafaker's own pages, with the date it was checked.
What it does
- Build tools
- The project README provides dependency examples for Maven and Gradle.checked 8 Oct 2026
- Current release
- The getting started page identifies version 2.7.0 as the latest version.checked 8 Oct 2026
- Custom data
- Users can create custom providers in code or load provider data from YAML files.checked 8 Oct 2026
- Customization
- The README links instructions for adding custom providers to an application.checked 8 Oct 2026
- Data providers
- The site lists 263 data providers across base, entertainment, food, healthcare, sport, and videogame groups.checked 8 Oct 2026
- Expressions
- Expressions support replacements such as letters, digits, regular-expression-based output, and generated CSV or JSON.checked 8 Oct 2026
- Installation
- The library is hosted on Maven Central and the site shows Maven, Gradle, and Ivy dependency examples.checked 8 Oct 2026
- Java requirement
- For Datafaker 2.x, Java 17 is the target; the site recommends Datafaker 1.x for older Java versions.checked 8 Oct 2026
- Languages
- The project describes support for Java, Kotlin, and Groovy.checked 8 Oct 2026
- License
- The project repository identifies its license as Apache-2.0.checked 8 Oct 2026
- Minimum Java version
- Datafaker 2.x requires Java 17; the README says Datafaker 1.x is built on Java 8 and is no longer maintained.checked 8 Oct 2026
- Output formats
- The README describes generating CSV and JSON, and points to documentation for YAML and XML; the formats page labels its XML functionality deprecated.checked 8 Oct 2026
- Provider customization
- A custom faker can extend Faker and register a custom provider for use in code.checked 8 Oct 2026
- Providers
- The homepage says Datafaker offers more than 250 data providers.checked 8 Oct 2026
- Purpose
- Datafaker is a Java and Kotlin library for generating fake data for test databases, stress tests, or anonymizing production data.checked 8 Oct 2026
- Release
- The site lists version 2.7.0 as a release.checked 8 Oct 2026
- Release feature
- Version 2.7.0 added an HTTP faker for status codes, headers, user agents, and more.checked 8 Oct 2026
- Sequences
- Datafaker supports fake collections and fake streams, including sequences with configurable lengths and null rates.checked 8 Oct 2026
- Use case
- The project says it is useful when developing a new project and needing data for a showcase.checked 8 Oct 2026
- Use of YAML
- The documentation says YAML files may be preferable when a custom provider needs to load a large data set.checked 8 Oct 2026
- Weighted selection
- Weighted random selection is documented as proof of concept and currently available only for custom hardcoded providers.checked 8 Oct 2026
The company
- Maker attribution
- The documentation footer credits Erik Pragt and shows copyright years 2016–2026.checked 8 Oct 2026
Alternatives to Datafaker
- 1

Benerator
Free planOpen sourceWebAPILinuxmacOS7.6Free plan - 2
RandomUser
Free planOpen sourceWebAPIExtensionSelf-hosted7.1Free plan - 3

Tonic Fabricate
Free planWebAPISelf-hosted6.8$29 usage-based - 4

Mockaroo
Free planWebAPISelf-hosted6.7From $60 a year - 5

Synthetic Data Vault
Free planAPISelf-hosted6.6From $250 a month - 6
Chance.js
Free planWebAPI6.4Free plan
