...the only fake-data-generation library you'd need on the JVM

Kotlin-faker is a comprehensive data-generation library which provides realistic-looking, fake-data-generation capabilities within a variety of domains, like names ๐Ÿ“‡, addresses ๐Ÿก, internet ๐ŸŒ, banking ๐Ÿ’ธ, books ๐Ÿ“–, games ๐ŸŽฎ, and many more.
It can be used with Kotlin, Java, Android, Scala, and other JVM-based projects.
Ensure your application data looks as if it was real, just like our really fake logo, but not quite so.

We fake it.

You make it.

In fact, kotlin-faker is so good at generating fake data,
it almost fooled us into thinking it was real! ๐Ÿ˜ฑ

From names that sound like they belong to secret agents ๐Ÿ•ด๏ธ
to addresses where superheroes ๐Ÿฆธ might live.

What kind of data?

Our focus is on creating realistically-looking fake data that is most suitable for development, testing, and data anonymization purposes through data generators that provide...

...a plethora of real-looking data in various domains:

val faker = Faker()

Names

faker.name.nameWithMiddle() // => Dr. John Abrams Smith

Addresses

faker.address.streetAddress() // => 474 Kilback Manor

Internet

faker.internet.safeEmail() // => chance.marvin@yahoo.test

Banking

val faker = CommerceFaker()
faker.bank.swiftBic() // => AACCGB21
Books
val faker = BooksFaker()
faker.book.genre() // => Fantasy

Movies and TV

val faker = MoviesFaker()
faker.starWars.characters() // => Darth Vader
val faker = TvShowsFaker()
faker.friends.characters() // => Phoebe Buffay

...and many more!

// a total of 213 different data generators

Tell me more...

โ€ฆdata in 60+ locales:

name

val config = fakerConfig { locale = "nb-NO" }
val faker = Faker(config)

city

faker.address.city() // => Hรธyberg

โ€ฆunique data generation capabilities:

Unique values within a domain

faker.unique.configuration {
    // enable generation of unique values
    // for address data provider
    enable(faker::address)
}
val countries = List(100) { faker.address.country() }
assertEquals(countries.distinct().size, 100)

Unique values within a function

val countries = List(100) {
  faker.address.unique.country()
}
val cities = List(1000) {
  faker.address.city()
}

assertEquals(countries.distinct().size, 100)
assertTrue(cities.distinct().size < 1000)

โ€ฆcli app for generator functionality lookup:

faker-bot lookup name --verbose
#Faker()
#โ”œโ”€โ”€ address
#โ”‚   โ”œโ”€โ”€ cityName() // => Port Olinstad
#โ”‚   โ”œโ”€โ”€ countryByName() // => NR
#โ”‚   โ””โ”€โ”€ streetName() // => Lance Roads
#โ”œโ”€โ”€ animal
#โ”‚   โ””โ”€โ”€ name() // => gnat
#โ”œโ”€โ”€ app
#โ”‚   โ””โ”€โ”€ name() // => Bamity
#โ”œโ”€โ”€ artist
#โ”‚   โ””โ”€โ”€ names() // => Cezanne
#โ”œโ”€โ”€ bank
#โ”‚   โ””โ”€โ”€ name() // => ABN AMRO HOARE GOVETT SECURITIES
#โ”œโ”€โ”€ beer
#โ”‚   โ””โ”€โ”€ name() // => Oaked Arrogant Bastard Ale
# rest of output that matches query

โ€ฆand more:

Random instance of any classโ€ฆ

class Foo(val a: String)
class Bar(val foo: Foo)

val foo: Foo = faker.randomClass.randomClassInstance()
val bar: Bar = faker.randomClass.randomClassInstance()

โ€ฆwith pre-configured type generation

fun string() = "X3a8s813dcb"
fun uuid() = "00000000-0000-0000-0000-000000000000"
class Baz(
  val id: Int,
  val uuid: UUID,
  val username: String
)

val baz: Baz = faker.randomClass.randomClassInstance {
    // ใƒฝ(^o^)ไธฟ แ••(แ›)แ•— Prepend string type parameter
    // values with parameter name!
    typeGenerator<String> { parameterInfo ->
      "${parameterInfo.name}_${string()}"
    }
    typeGenerator<UUID> { UUID.fromString(uuid()) }
    typeGenerator<Int> {
      faker.random.nextInt(min = 0, max = 9)
    }
}

assertEquals(baz.username, "username_${string()}")
assertEquals( baz.uuid, UUID.fromString(uuid()))
assertTrue(baz.id in 0..9)

String templating

faker.string.numerify("foo###bar") // foo123bar
faker.string.letterify("foo???bar", true) // fooXYZbar
faker.string.bothify("foo?##bar", false) // foox42bar
faker.string.regexify("""\d{2}\w""") // 42a

Random numbers, strings, enums, UUIDs, and moreโ€ฆ

faker.random.nextInt(intRange = 0..1000)
faker.random.nextLong(bound = 999L)
faker.random.randomString(length = 99)
faker.random.nextEnum<TestEnum>()
faker.random.nextEnum(TestEnum::class.java) {
    it != TestEnum.SOME // Exclude 'SOME' enum
}
faker.random.nextUUID()

WARNING

โš ๏ธ โš ๏ธ โš ๏ธ

All names, addresses, bank accounts, and other data generated by this library - even those based on real strings - are entirely fictional. ๐Ÿฆน
All produced data is fake and generated... poorly ๐Ÿ’ฉ
The data is completely made up, but the problems that it tries to solve are real ๐Ÿ‘ฝ
We take no responsibility for any existential crises caused by the eerily convincing fake data.
Use with caution!

Why ?

While other data fakers exist, kotlin-faker is built from the ground up to be the most powerful, flexible, and developer-friendly choice for the modern JVM ecosystem.

Kotlin
First

An idiomatic Kotlin DSL makes your data-generation code clean, readable, and type-safe.

No more dealing with awkward Java interop or legacy library design. It just feels right.

Unrivaled
Coverage

With 213+ data providers and 60+ locales, it has the most comprehensive and diverse dataset of any JVM faker library.

From Address and Name to obscure Esport teams, Games and Lord of the Rings characters, the all the data you could need is readily available.

Unique
& Powerful

Generate truly unique values at the provider or function level, a critical feature for realistic testing that others lack.

A handy CLI application lets you explore the data that can be generated and how to generate it.

Blazing Fast & Actively Maintained

When benchmarked against legacy Java fakers, kotlin-faker is up to 4x faster, saving you valuable time in your test and build cycles.

Unlike many older libraries that are no longer maintained, kotlin-faker is actively developed, ensuring it stays up-to-date with new data and features.

Supported Tech-Stack