Skip to content

Person ​

Module to generate people's personal information such as names and job titles. Prior to Faker 8.0.0, this module was known as faker.name.

Overview ​

To generate a full name, use fullName. Note that this is not the same as simply concatenating firstName and lastName, as the full name may contain a prefix, suffix, or both. Additionally, different supported locales will have differing name patterns. For example, the last name may appear before the first name, or there may be a double or hyphenated first or last name.

You can also generate the parts of a name separately, using prefix, firstName, middleName, lastName, and suffix. Not all locales support all of these parts.

Many of the methods in this module can optionally choose either female, male or mixed names.

Job-related data is also available. To generate a job title, use jobTitle.

This module can also generate other personal information which might appear in user profiles, such as gender, zodiacSign, and bio.

For personal contact information like phone numbers and email addresses, see the faker.phone and faker.internet modules.

bio ​

Returns a random short biography

Available since v8.0.0

Returns: string

ts
function bio(): string;

Examples

ts
faker.person.bio() // 'oatmeal advocate, veteran 🐠'

firstName ​

Returns a random first name.

Available since v8.0.0

Parameters

NameTypeDefaultDescription
sex?
Is used for values that are primarily attributable to only females.
|
Is used for values that cannot clearly be attributed to a specific sex or are used for both sexes.
|
Is used for values that are primarily attributable to only males.

The optional sex to use. Can be either 'female' or 'male'.

Returns: string

ts
function firstName(sex?: SexType): string;

Examples

ts
faker.person.firstName() // 'Antwan'
faker.person.firstName('female') // 'Victoria'
faker.person.firstName('male') // 'Tom'

fullName ​

Generates a random full name.

Available since v8.0.0

Parameters

NameTypeDefaultDescription
options{ … }{}

An options object.

options.firstName?stringfaker.person.firstName(sex)

The optional first name to use. If not specified a random one will be chosen.

options.lastName?stringfaker.person.lastName(sex)

The optional last name to use. If not specified a random one will be chosen.

options.sex?
Is used for values that are primarily attributable to only females.
|
Is used for values that cannot clearly be attributed to a specific sex or are used for both sexes.
|
Is used for values that are primarily attributable to only males.
faker.helpers.arrayElement([Sex.Female, Sex.Male])

The optional sex to use. Can be either 'female' or 'male'.

Returns: string

ts
function fullName(
  options: {
    firstName?: string;
    lastName?: string;
    sex?: SexType;
  } = {}
): string;

Examples

ts
faker.person.fullName() // 'Allen Brown'
faker.person.fullName({ firstName: 'Joann' }) // 'Joann Osinski'
faker.person.fullName({ firstName: 'Marcella', sex: 'female' }) // 'Mrs. Marcella Huels'
faker.person.fullName({ lastName: 'Beer' }) // 'Mr. Alfonso Beer'
faker.person.fullName({ sex: 'male' }) // 'Fernando Schaefer'

gender ​

Returns a random gender.

Available since v8.0.0

Returns: string

ts
function gender(): string;

Examples

ts
faker.person.gender() // 'Trans*Man'

jobArea ​

Generates a random job area.

Available since v8.0.0

Returns: string

ts
function jobArea(): string;

Examples

ts
faker.person.jobArea() // 'Brand'

jobDescriptor ​

Generates a random job descriptor.

Available since v8.0.0

Returns: string

ts
function jobDescriptor(): string;

Examples

ts
faker.person.jobDescriptor() // 'Customer'

jobTitle ​

Generates a random job title.

Available since v8.0.0

Returns: string

ts
function jobTitle(): string;

Examples

ts
faker.person.jobTitle() // 'Global Accounts Engineer'

jobType ​

Generates a random job type.

Available since v8.0.0

Returns: string

ts
function jobType(): string;

Examples

ts
faker.person.jobType() // 'Assistant'

lastName ​

Returns a random last name.

Available since v8.0.0

Parameters

NameTypeDefaultDescription
sex?
Is used for values that are primarily attributable to only females.
|
Is used for values that cannot clearly be attributed to a specific sex or are used for both sexes.
|
Is used for values that are primarily attributable to only males.

The optional sex to use. Can be either 'female' or 'male'.

Returns: string

ts
function lastName(sex?: SexType): string;

Examples

ts
faker.person.lastName() // 'Hauck'
faker.person.lastName('female') // 'Grady'
faker.person.lastName('male') // 'Barton'

middleName ​

Returns a random middle name.

Available since v8.0.0

Parameters

NameTypeDefaultDescription
sex?
Is used for values that are primarily attributable to only females.
|
Is used for values that cannot clearly be attributed to a specific sex or are used for both sexes.
|
Is used for values that are primarily attributable to only males.

The optional sex to use. Can be either 'female' or 'male'.

Returns: string

ts
function middleName(sex?: SexType): string;

Examples

ts
faker.person.middleName() // 'James'
faker.person.middleName('female') // 'Eloise'
faker.person.middleName('male') // 'Asher'

prefix ​

Returns a random person prefix.

Available since v8.0.0

Parameters

NameTypeDefaultDescription
sex?
Is used for values that are primarily attributable to only females.
|
Is used for values that cannot clearly be attributed to a specific sex or are used for both sexes.
|
Is used for values that are primarily attributable to only males.

The optional sex to use. Can be either 'female' or 'male'.

Returns: string

ts
function prefix(sex?: SexType): string;

Examples

ts
faker.person.prefix() // 'Miss'
faker.person.prefix('female') // 'Ms.'
faker.person.prefix('male') // 'Mr.'

sex ​

Returns a random sex.

Output of this method is localised, so it should not be used to fill the parameter sex available in some other modules for example faker.person.firstName().

Available since v8.0.0

Returns: string

ts
function sex(): string;

Examples

ts
faker.person.sex() // 'female'

sexType ​

Returns a random sex type. The SexType is intended to be used in parameters and conditions.

Available since v8.0.0

Parameters

NameTypeDefaultDescription
options{ … }{}

The optional options object.

options.includeGeneric?booleanfalse

Whether 'generic' should be included in the potential outputs. If false, this method only returns 'female' and 'male'.

Returns: 'female' | 'generic' | 'male'

ts
function sexType(
  options: {
    includeGeneric?: boolean;
  } = {}
): SexType;

Examples

ts
faker.person.sexType() // Sex.Female
faker.person.sexType({ includeGeneric: true }) // Sex.Generic

suffix ​

Returns a random person suffix.

Available since v8.0.0

Returns: string

ts
function suffix(): string;

Examples

ts
faker.person.suffix() // 'DDS'

zodiacSign ​

Returns a random zodiac sign.

Available since v8.0.0

Returns: string

ts
function zodiacSign(): string;

Examples

ts
faker.person.zodiacSign() // 'Pisces'

Released under the MIT License.