A quick reference for the most commonly used random data generator functions.
Address
building_number(range \\ 1..100, opts \\ [])
iex> NeoFaker.Address.building_number()
"42"
iex> NeoFaker.Address.building_number(1..100, type: :integer)
25city(opts \\ [])
iex> NeoFaker.Address.city()
"Saint Marys City"
iex> NeoFaker.Address.city(locale: :id_id)
"Palu"NeoFaker.Address.country/1 behaves the same way, generating a random country name.
coordinate(opts \\ [])
iex> NeoFaker.Address.coordinate()
{11.5831672, 165.3662683}
iex> NeoFaker.Address.coordinate(type: :latitude)
11.5831672
iex> NeoFaker.Address.coordinate(type: :longitude)
165.3662683
iex> NeoFaker.Address.coordinate(precision: 2)
{11.58, 165.37}
iex> NeoFaker.Address.coordinate(type: :latitude, precision: 4)
11.5832App
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 package 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"NeoFaker.Blood.rh_factor/0 behaves the same way, returning only the Rh factor.
medical_notation(opts \\ [])
iex> NeoFaker.Blood.medical_notation()
"B positive"
iex> NeoFaker.Blood.medical_notation(verbose: true)
"Type AB, Rh positive"Boolean
boolean(true_ratio \\ 50, opts \\ [])
iex> NeoFaker.Boolean.boolean()
false
iex> NeoFaker.Boolean.boolean(75)
true
iex> NeoFaker.Boolean.boolean(75, integer: true)
1Color
cmyk(opts \\ [])
iex> NeoFaker.Color.cmyk()
{0, 25, 50, 100}
iex> NeoFaker.Color.cmyk(format: :w3c)
"cmyk(0%, 25%, 50%, 100%)"NeoFaker.Color.hsl/1, NeoFaker.Color.hsla/1, NeoFaker.Color.rgb/1, and
NeoFaker.Color.rgba/1 behave the same way, generating colors in their respective formats.
Pass format: :w3c to any of them for a CSS string.
hex(opts \\ [])
iex> NeoFaker.Color.hex()
"#613583"
iex> NeoFaker.Color.hex(format: :three_digit)
"#365"
iex> NeoFaker.Color.hex(format: :eight_digit)
"#613583FF"keyword(opts \\ [])
iex> NeoFaker.Color.keyword()
"blueviolet"
iex> NeoFaker.Color.keyword(category: :basic)
"purple"
iex> NeoFaker.Color.keyword(locale: :id_id)
"ungu"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"NeoFaker.Crypto.sha1/1, NeoFaker.Crypto.sha256/1, and NeoFaker.Crypto.sha512/1 behave
the same way. NeoFaker.Crypto.hash/2 accepts a :md5, :sha1, :sha256, or :sha512
atom as the first argument.
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"token(length \\ 32, opts \\ [])
iex> NeoFaker.Crypto.token()
"dGVzdF90b2tlbl9oZXJl"
iex> NeoFaker.Crypto.token(32, encoding: :hex)
"a1b2c3d4e5f6708192a3b4c5d6e7f809"Date
add(range \\ -365..365, opts \\ [])
iex> NeoFaker.Date.add()
~D[2025-03-25]
iex> NeoFaker.Date.add(0..31)
~D[2025-03-30]
iex> NeoFaker.Date.add(0..31, format: :iso8601)
"2025-03-30"between(start, finish, opts \\ [])
iex> NeoFaker.Date.between()
~D[2014-07-11]
iex> NeoFaker.Date.between(~D[2020-01-01], ~D[2025-01-01])
~D[2022-08-17]
iex> NeoFaker.Date.between(~D[2025-03-25], ~D[2025-03-25], format: :iso8601)
"2025-03-25"birthday(min_age \\ 18, max_age \\ 65, opts \\ [])
iex> NeoFaker.Date.birthday()
~D[1997-01-02]
iex> NeoFaker.Date.birthday(18, 65)
~D[1998-03-04]
iex> NeoFaker.Date.birthday(18, 65, format: :iso8601)
"1999-05-06"past(days \\ 365, opts \\ [])
iex> NeoFaker.Date.past()
~D[2024-10-01]
iex> NeoFaker.Date.past(30, format: :iso8601)
"2025-02-25"future(days \\ 365, opts \\ [])
iex> NeoFaker.Date.future()
~D[2026-01-10]
iex> NeoFaker.Date.future(30, format: :iso8601)
"2025-04-24"today(opts \\ [])
iex> NeoFaker.Date.today()
~D[2025-03-25]
iex> NeoFaker.Date.today(format: :iso8601)
"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"NeoFaker.Gravatar.random/0 generates a display URL with a randomly selected size and
fallback type.
HTTP
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)
"Mozilla/5.0 (compatible; Google-InspectionTool/1.0)"request_method(opts \\ [])
iex> NeoFaker.HTTP.request_method()
"GET"
iex> NeoFaker.HTTP.request_method(common_only: false)
"OPTIONS"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"referrer_policy()
iex> NeoFaker.HTTP.referrer_policy()
"no-referrer"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"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."NeoFaker.Lorem.sentence/1 and NeoFaker.Lorem.word/1 behave the same way, generating a
random sentence or word. NeoFaker.Lorem.paragraphs/2, NeoFaker.Lorem.sentences/2, and
NeoFaker.Lorem.words/2 return lists and accept a join: true option to return a single string.
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(10.0, 100.0)
55.123456789digit()
iex> NeoFaker.Number.digit()
5float(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.44decimal(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.7384positive(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)
-27Person
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"NeoFaker.Person.middle_name/1 and NeoFaker.Person.last_name/1 behave the same way,
generating a middle or last name with the same options.
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."NeoFaker.Person.suffix/1 behaves the same way, generating a name suffix such as "Jr." or
"III".
binary_gender(opts \\ [])
iex> NeoFaker.Person.binary_gender()
"Male"
iex> NeoFaker.Person.binary_gender(locale: :id_id)
"Perempuan"NeoFaker.Person.non_binary_gender/1 and NeoFaker.Person.short_binary_gender/1 behave the
same way.
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"NeoFaker.Text.words/2 returns a list of random words and accepts join: true and
separator: options to return a single joined string.
Time
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]
iex> NeoFaker.Time.add(0..10, format: :iso8601)
"15:22:10"between(start, finish, opts \\ [])
iex> NeoFaker.Time.between()
~T[15:22:10]
iex> NeoFaker.Time.between(~T[00:00:00], ~T[23:59:59])
~T[19:30:11]
iex> NeoFaker.Time.between(~T[00:00:00], ~T[23:59:59], format: :iso8601)
"19:30:11"NeoFaker.Time.morning/1 (06:00–11:59), NeoFaker.Time.afternoon/1 (12:00–17:59),
NeoFaker.Time.evening/1 (18:00–23:59), and NeoFaker.Time.night/1 (00:00–05:59) are
convenience wrappers around between/3 for named time periods.
time_zone()
iex> NeoFaker.Time.time_zone()
"Asia/Makassar"now(opts \\ [])
iex> NeoFaker.Time.now()
~T[15:22:10]
iex> NeoFaker.Time.now(format: :iso8601)
"15:22:10"