A quick reference for every random data generator function, grouped by domain. Every function
that accepts a keyword list of options ships with a default, so it works with zero arguments
too. For country-specific formats that don't fit a shared :locale option, like US Social
Security Numbers or Indonesian NIK/NPWP, see the Locale Cheat Sheet.
Address
building_number(range \\ 1..100)
iex> NeoFaker.Address.building_number()
"42"
iex> NeoFaker.Address.building_number(1..100)
"25"city(opts \\ [])
iex> NeoFaker.Address.city()
"Saint Marys City"
iex> NeoFaker.Address.city(locale: :id_id)
"Palu"country(opts \\ [])
iex> NeoFaker.Address.country()
"United States"
iex> NeoFaker.Address.country(locale: :id_id)
"Amerika Serikat"coordinate(opts \\ [])
iex> NeoFaker.Address.coordinate()
{11.5831672, 165.3662683}
iex> NeoFaker.Address.coordinate(precision: 2)
{11.58, 165.37}latitude(opts \\ []) / longitude(opts \\ [])
iex> NeoFaker.Address.latitude()
11.5831672
iex> NeoFaker.Address.longitude(precision: 4)
165.3663App
author(opts \\ [])
iex> NeoFaker.App.author()
"José Valim"
iex> NeoFaker.App.author(middle_name: true)
"José Carlos Valim"
iex> NeoFaker.App.author(sex: :female)
"Juliana Silva"description(opts \\ [])
iex> NeoFaker.App.description()
"Elixir library for generating fake data in tests and development."
iex> NeoFaker.App.description(locale: :id_id)
"Pustaka Elixir untuk menghasilkan data palsu dalam pengujian dan pengembangan."license()
iex> NeoFaker.App.license()
"MIT License"name(opts \\ [])
iex> NeoFaker.App.name()
"Neo Faker"
iex> NeoFaker.App.name(style: :camel_case)
"neoFaker"
iex> NeoFaker.App.name(style: :dashed)
"neo-faker"
iex> NeoFaker.App.name(locale: :id_id)
"Garuda Web"semver(opts \\ [])
iex> NeoFaker.App.semver()
"1.2.3"
iex> NeoFaker.App.semver(type: :pre_release)
"1.2.3-beta.1"
iex> NeoFaker.App.semver(type: :build)
"1.2.3+20250325"
iex> NeoFaker.App.semver(type: :pre_release_build)
"1.2.3-rc.1+20250325"version()
iex> NeoFaker.App.version()
"1.2"bundle_id(opts \\ [])
iex> NeoFaker.App.bundle_id()
"com.example.neo_faker"
iex> NeoFaker.App.bundle_id(style: :dashed)
"com.example.neo-faker"
iex> NeoFaker.App.bundle_id(domain: "mycompany.io")
"io.mycompany.neo_faker"package_name(opts \\ [])
iex> NeoFaker.App.package_name()
"com.example.neofaker"
iex> NeoFaker.App.package_name(domain: "mycompany.id")
"id.mycompany.neofaker"Blood
group(opts \\ [])
iex> NeoFaker.Blood.group()
"B+"
iex> NeoFaker.Blood.group(format: :type_only)
"O"
iex> NeoFaker.Blood.group(format: :rh_only)
"-"type()
iex> NeoFaker.Blood.type()
"B"rh_factor()
iex> NeoFaker.Blood.rh_factor()
"+"medical_notation(opts \\ [])
iex> NeoFaker.Blood.medical_notation()
"B positive"
iex> NeoFaker.Blood.medical_notation(verbose: true)
"Type AB, Rh positive"all_types()
iex> NeoFaker.Blood.all_types()
["A", "B", "AB", "O"]all_rh_factors()
iex> NeoFaker.Blood.all_rh_factors()
["+", "-"]Boolean
boolean(true_ratio \\ 50)
iex> NeoFaker.Boolean.boolean()
false
iex> NeoFaker.Boolean.boolean(75)
true
iex> NeoFaker.Boolean.boolean(0)
false
iex> NeoFaker.Boolean.boolean(100)
trueColor
cmyk(opts \\ [])
iex> NeoFaker.Color.cmyk()
{0, 25, 50, 100}
iex> NeoFaker.Color.cmyk(format: :w3c)
"cmyk(0%, 25%, 50%, 100%)"hex(opts \\ [])
iex> NeoFaker.Color.hex()
"#613583"
iex> NeoFaker.Color.hex(format: :three_digit)
"#365"
iex> NeoFaker.Color.hex(format: :eight_digit)
"#613583FF"hsl(opts \\ [])
iex> NeoFaker.Color.hsl()
{180, 50, 75}
iex> NeoFaker.Color.hsl(format: :w3c)
"hsl(180, 50%, 75%)"hsla(opts \\ [])
iex> NeoFaker.Color.hsla()
{180, 50, 75, 0.8}
iex> NeoFaker.Color.hsla(format: :w3c)
"hsla(180, 50%, 75%, 0.8)"keyword(opts \\ [])
iex> NeoFaker.Color.keyword()
"blueviolet"
iex> NeoFaker.Color.keyword(category: :basic)
"purple"
iex> NeoFaker.Color.keyword(locale: :id_id)
"ungu"rgb(opts \\ [])
iex> NeoFaker.Color.rgb()
{255, 128, 64}
iex> NeoFaker.Color.rgb(format: :w3c)
"rgb(255, 128, 64)"rgba(opts \\ [])
iex> NeoFaker.Color.rgba()
{255, 128, 64, 0.8}
iex> NeoFaker.Color.rgba(format: :w3c)
"rgba(255, 128, 64, 0.8)"random(opts \\ [])
iex> NeoFaker.Color.random()
{255, 128, 64}
iex> NeoFaker.Color.random()
"#613583"
iex> NeoFaker.Color.random(format: :w3c)
"rgb(255, 128, 64)"Crypto
md5(opts \\ [])
iex> NeoFaker.Crypto.md5()
"afc4c626c55e4166421d82732163857d"
iex> NeoFaker.Crypto.md5(case: :upper)
"AFC4C626C55E4166421D82732163857D"sha1(opts \\ [])
iex> NeoFaker.Crypto.sha1()
"356a192b7913b04c54574d18c28d46e6395428ab"sha256(opts \\ [])
iex> NeoFaker.Crypto.sha256()
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"sha512(opts \\ [])
iex> NeoFaker.Crypto.sha512()
"cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"hash(type, opts \\ [])
iex> NeoFaker.Crypto.hash(:md5)
"afc4c626c55e4166421d82732163857d"
iex> NeoFaker.Crypto.hash(:sha256, case: :upper)
"E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855"token(length \\ 32, opts \\ [])
iex> NeoFaker.Crypto.token()
"dGVzdF90b2tlbl9oZXJl"
iex> NeoFaker.Crypto.token(32, encoding: :hex)
"a1b2c3d4e5f6708192a3b4c5d6e7f8091a2b3c4d5e6f7081"uuid(opts \\ [])
iex> NeoFaker.Crypto.uuid()
"550e8400-e29b-41d4-a716-446655440000"
iex> NeoFaker.Crypto.uuid(format: :compact)
"550e8400e29b41d4a716446655440000"
iex> NeoFaker.Crypto.uuid(case: :upper)
"550E8400-E29B-41D4-A716-446655440000"Date
Every function returns a Date struct; pipe through Date.to_iso8601/1 for a string.
add(range \\ -365..365)
iex> NeoFaker.Date.add()
~D[2025-03-25]
iex> NeoFaker.Date.add(0..31)
~D[2025-03-30]between(start, finish)
iex> NeoFaker.Date.between()
~D[2014-07-11]
iex> NeoFaker.Date.between(~D[2020-01-01], ~D[2025-01-01])
~D[2022-08-17]birthday(min_age \\ 18, max_age \\ 65)
iex> NeoFaker.Date.birthday()
~D[1997-01-02]
iex> NeoFaker.Date.birthday(18, 65)
~D[1998-03-04]past(days \\ 365)
iex> NeoFaker.Date.past()
~D[2024-10-01]
iex> NeoFaker.Date.past(30)
~D[2025-02-25]future(days \\ 365)
iex> NeoFaker.Date.future()
~D[2026-01-10]
iex> NeoFaker.Date.future(30)
~D[2025-04-24]today()
iex> NeoFaker.Date.today()
~D[2025-03-25]Gravatar
display(email \\ nil, opts \\ [])
iex> NeoFaker.Gravatar.display()
"https://gravatar.com/avatar/<hash>?d=identicon&s=80"
iex> NeoFaker.Gravatar.display("john.doe@example.com", size: 100)
"https://gravatar.com/avatar/<hash>?d=identicon&s=100"
iex> NeoFaker.Gravatar.display("john.doe@example.com", fallback: :monsterid)
"https://gravatar.com/avatar/<hash>?d=monsterid&s=80"
iex> NeoFaker.Gravatar.display("user@test.com", rating: :pg)
"https://gravatar.com/avatar/<hash>?d=identicon&s=80&r=pg"
iex> NeoFaker.Gravatar.display("user@test.com", force_default: true)
"https://gravatar.com/avatar/<hash>?d=identicon&s=80&f=y"profile(email \\ nil, opts \\ [])
iex> NeoFaker.Gravatar.profile()
"https://gravatar.com/<hash>"
iex> NeoFaker.Gravatar.profile("user@example.com", format: :json)
"https://gravatar.com/<hash>.json"
iex> NeoFaker.Gravatar.profile(nil, format: :qr)
"https://gravatar.com/<hash>.qr"random_display()
iex> NeoFaker.Gravatar.random_display()
"https://gravatar.com/avatar/<hash>?d=monsterid&s=150"fallback_types()
iex> NeoFaker.Gravatar.fallback_types()
[:identicon, :monsterid, :wavatar, :robohash, :retro, :blank, :"404"]default_size()
iex> NeoFaker.Gravatar.default_size()
80size_range()
iex> NeoFaker.Gravatar.size_range()
1..2048HTTP
user_agent(opts \\ [])
iex> NeoFaker.HTTP.user_agent()
"Mozilla/5.0 (X11; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0"
iex> NeoFaker.HTTP.user_agent(type: :browser)
"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0"
iex> NeoFaker.HTTP.user_agent(type: :crawler)
"ahrefsbot"
iex> NeoFaker.HTTP.user_agent(type: :ai)
"claude-user"request_method(opts \\ [])
iex> NeoFaker.HTTP.request_method()
"GET"
iex> NeoFaker.HTTP.request_method(common_only: false)
"OPTIONS"referrer_policy()
iex> NeoFaker.HTTP.referrer_policy()
"no-referrer"status_code(opts \\ [])
iex> NeoFaker.HTTP.status_code()
"200"
iex> NeoFaker.HTTP.status_code(type: :detailed)
"200 OK"
iex> NeoFaker.HTTP.status_code(group: :client_error)
"404"
iex> NeoFaker.HTTP.status_code(type: :detailed, group: :success)
"201 Created"protocol_version(opts \\ [])
iex> NeoFaker.HTTP.protocol_version()
"HTTP/1.1"
iex> NeoFaker.HTTP.protocol_version(include_http3: false)
"HTTP/1.0"header_name(opts \\ [])
iex> NeoFaker.HTTP.header_name()
"Content-Type"
iex> NeoFaker.HTTP.header_name(type: :request)
"User-Agent"
iex> NeoFaker.HTTP.header_name(type: :response)
"Server"all_request_methods()
iex> NeoFaker.HTTP.all_request_methods()
["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "TRACE", "CONNECT", "QUERY"]all_referrer_policies()
iex> NeoFaker.HTTP.all_referrer_policies()
["no-referrer", "no-referrer-when-downgrade", "same-origin", ...]Internet
username(opts \\ [])
iex> NeoFaker.Internet.username()
"josé_valim"
iex> NeoFaker.Internet.username(word_count: 3, joiner: :dot)
"abigail.bethany.crawford"
iex> NeoFaker.Internet.username(username_type: :word, number: true, number_range: 1..2025)
"elixir_alchemist_2012"domain_name(opts \\ [])
iex> NeoFaker.Internet.domain_name()
"example"
iex> NeoFaker.Internet.domain_name(word_count: 3)
"alpha-beta-gamma"
iex> NeoFaker.Internet.domain_name(type: :popular, popular_type: :email)
"gmail.com"
iex> NeoFaker.Internet.domain_name(type: :custom, domain_name: "elixir-lang.org")
"elixir-lang.org"tld(opts \\ [])
iex> NeoFaker.Internet.tld()
".com"
iex> NeoFaker.Internet.tld(dot: false)
"org"
iex> NeoFaker.Internet.tld(type: :safe)
".example"
iex> NeoFaker.Internet.tld(type: :country_code)
".id"email(opts \\ [])
iex> NeoFaker.Internet.email()
"josé@example.com"
iex> NeoFaker.Internet.email(username_word_count: 3, joiner: :dot, number: true)
"abigail.bethany.crawford_202@example.com"
iex> NeoFaker.Internet.email(domain_type: :popular, popular_type: :email)
"jane.doe@gmail.com"
iex> NeoFaker.Internet.email(domain_type: :custom, domain_name: "elixir-lang.org")
"josé@elixir-lang.org"ipv4(opts \\ [])
iex> NeoFaker.Internet.ipv4()
"183.235.34.108"
iex> NeoFaker.Internet.ipv4(private: true)
"192.168.1.42"
iex> NeoFaker.Internet.ipv4(private: true, class: :a)
"10.25.30.100"ipv6(opts \\ [])
iex> NeoFaker.Internet.ipv6()
"E0E6:7E24:EC6E:E44C:FC69:9C25:CD85:CE08"
iex> NeoFaker.Internet.ipv6(uppercase: false)
"e0e6:7e24:ec6e:e44c:fc69:9c25:cd85:ce08"
iex> NeoFaker.Internet.ipv6(compressed: true)
"2001:db8::8a2e:370:7334"mac_address(opts \\ [])
iex> NeoFaker.Internet.mac_address()
"74:4E:44:B0:D0:93"
iex> NeoFaker.Internet.mac_address(uppercase: false)
"74:4e:44:b0:d0:93"
iex> NeoFaker.Internet.mac_address(separator: "-")
"74-4E-44-B0-D0-93"url(opts \\ [])
iex> NeoFaker.Internet.url()
"https://example.com"
iex> NeoFaker.Internet.url(protocol: :http)
"http://neo-faker.org"
iex> NeoFaker.Internet.url(path: true)
"https://example.com/users/profile"
iex> NeoFaker.Internet.url(path: true, query: true)
"https://example.com/api/v1?key=value&id=123"slug(word_count \\ 3, opts \\ [])
iex> NeoFaker.Internet.slug()
"neo-faker-elixir"
iex> NeoFaker.Internet.slug(5)
"the-quick-brown-fox-jumps"
iex> NeoFaker.Internet.slug(2, separator: "_")
"hello_world"Lorem
paragraph(opts \\ [])
iex> NeoFaker.Lorem.paragraph()
"Suspendisse ac justo venenatis, tincidunt sapien nec, accumsan augue. Vestibulum urna
risus, egestas ut ultrices non, aliquet eget massa."
iex> NeoFaker.Lorem.paragraph(text: :meditations)
"Do the things external which fall upon thee distract thee? Give thyself time to learn
something new and good, and cease to be whirled around."sentence(opts \\ [])
iex> NeoFaker.Lorem.sentence()
"Suspendisse ac justo venenatis, tincidunt sapien nec, accumsan augue."
iex> NeoFaker.Lorem.sentence(text: :meditations)
"Do the things external which fall upon thee distract thee?"word(opts \\ [])
iex> NeoFaker.Lorem.word()
"suspendisse"
iex> NeoFaker.Lorem.word(text: :meditations)
"distract"The plural functions return a list; join it yourself with Enum.join/2.
paragraphs(count \\ 3, opts \\ [])
iex> NeoFaker.Lorem.paragraphs(2)
["First paragraph...", "Second paragraph..."]sentences(count \\ 5, opts \\ [])
iex> NeoFaker.Lorem.sentences(3)
["First sentence.", "Second sentence.", "Third sentence."]words(count \\ 10, opts \\ [])
iex> NeoFaker.Lorem.words(5)
["suspendisse", "justo", "venenatis", "sapien", "accumsan"]Number
between(min \\ 0, max \\ 100)
iex> NeoFaker.Number.between()
27
iex> NeoFaker.Number.between(1, 100)
28
iex> NeoFaker.Number.between(20, 100.0)
29.481745280074264
iex> NeoFaker.Number.between(50, 50)
50float(left_digit \\ 10..100, right_digit \\ 10_000..100_000)
iex> NeoFaker.Number.float()
30.94372
iex> NeoFaker.Number.float(1..9, 10..90)
1.44digit()
iex> NeoFaker.Number.digit()
5positive(max \\ 100)
iex> NeoFaker.Number.positive()
42
iex> NeoFaker.Number.positive(50)
27negative(min \\ -100)
iex> NeoFaker.Number.negative()
-42
iex> NeoFaker.Number.negative(-50)
-27decimal(min \\ 0.0, max \\ 100.0, precision \\ 2)
iex> NeoFaker.Number.decimal()
42.73
iex> NeoFaker.Number.decimal(0.0, 10.0, 2)
5.47
iex> NeoFaker.Number.decimal(0.0, 1.0, 4)
0.7384Person
first_name(opts \\ [])
iex> NeoFaker.Person.first_name()
"Julia"
iex> NeoFaker.Person.first_name(sex: :male)
"José"
iex> NeoFaker.Person.first_name(locale: :id_id)
"Jaka"middle_name(opts \\ [])
iex> NeoFaker.Person.middle_name()
"Anne"
iex> NeoFaker.Person.middle_name(sex: :male)
"James"last_name(opts \\ [])
iex> NeoFaker.Person.last_name()
"Smith"
iex> NeoFaker.Person.last_name(locale: :id_id)
"Wijaya"full_name(opts \\ [])
iex> NeoFaker.Person.full_name()
"Abigail Bethany Crawford"
iex> NeoFaker.Person.full_name(sex: :male)
"Daniel Edward Fisher"
iex> NeoFaker.Person.full_name(middle_name: false)
"Gabriella Harrison"
iex> NeoFaker.Person.full_name(sex: :female, locale: :id_id, middle_name: false)
"Siti Nurhaliza"full_name_with_title(opts \\ [])
iex> NeoFaker.Person.full_name_with_title(prefix: true)
"Dr. Abigail Bethany Crawford"
iex> NeoFaker.Person.full_name_with_title(suffix: true)
"Daniel Edward Fisher Jr."
iex> NeoFaker.Person.full_name_with_title(prefix: true, suffix: true, middle_name: false)
"Mr. John Smith III"prefix(opts \\ [])
iex> NeoFaker.Person.prefix()
"Mr."
iex> NeoFaker.Person.prefix(locale: :id_id)
"Tn."suffix(opts \\ [])
iex> NeoFaker.Person.suffix()
"Jr."
iex> NeoFaker.Person.suffix(locale: :id_id)
"S.Kom"gender(opts \\ [])
iex> NeoFaker.Person.gender()
"Male"
iex> NeoFaker.Person.gender(format: :short_binary)
"M"
iex> NeoFaker.Person.gender(format: :non_binary)
"Non-binary"
iex> NeoFaker.Person.gender(locale: :id_id)
"Perempuan"age(min \\ 0, max \\ 120)
iex> NeoFaker.Person.age()
44
iex> NeoFaker.Person.age(7, 44)
27
iex> NeoFaker.Person.age(18, 65)
35Text
character(opts \\ [])
iex> NeoFaker.Text.character()
"a"
iex> NeoFaker.Text.character(type: :digit)
"0"
iex> NeoFaker.Text.character(type: :alphabet_upper)
"A"
iex> NeoFaker.Text.character(type: :alphabet)
"X"characters(number \\ 11, opts \\ [])
iex> NeoFaker.Text.characters()
"XfELJU1mRMg"
iex> NeoFaker.Text.characters(20, type: :alphabet_upper)
"BVAJHRGSCEVJFNYSWCJE"
iex> NeoFaker.Text.characters(5, type: :digit)
"74392"
iex> NeoFaker.Text.characters(10, type: :alphabet_lower)
"xyzabcdefg"emoji(opts \\ [])
iex> NeoFaker.Text.emoji()
"✨"
iex> NeoFaker.Text.emoji(category: :activities)
"🎉"
iex> NeoFaker.Text.emoji(category: :smileys_and_emotion)
"🤖"
iex> NeoFaker.Text.emoji(category: :animals_and_nature)
"🐶"word()
iex> NeoFaker.Text.word()
"computer"words(count \\ 5)
iex> NeoFaker.Text.words(3)
["computer", "elixir", "phoenix"]Time
Every function returns a Time struct; pipe through Time.to_iso8601/1 for a string.
add(range \\ -24..24, opts \\ [])
iex> NeoFaker.Time.add()
~T[15:22:10]
iex> NeoFaker.Time.add(-2..2, unit: :minute)
~T[07:23:10]between(start, finish)
iex> NeoFaker.Time.between()
~T[15:22:10]
iex> NeoFaker.Time.between(~T[00:00:00], ~T[23:59:59])
~T[19:30:11]morning()
iex> NeoFaker.Time.morning()
~T[08:30:15]afternoon()
iex> NeoFaker.Time.afternoon()
~T[14:30:15]evening()
iex> NeoFaker.Time.evening()
~T[20:30:15]night()
iex> NeoFaker.Time.night()
~T[02:30:15]time_zone()
iex> NeoFaker.Time.time_zone()
"Asia/Makassar"now()
iex> NeoFaker.Time.now()
~T[15:22:10.123456]