Generate random first names, last names, or full names
Random name generator creates realistic fake names for testing, placeholder content, and privacy. Generates first names, last names, or full names from cultural name pools. Essential for test data, user interface mockups, and demo applications.
Maintains pools of common first and last names. Randomly selects one from each pool and combines. Advanced generators use cultural variations, gender-specific names, and weighted distributions based on real name frequency data.
Name pools sourced from census data or name databases. Weighted selection mimics real name distribution (common names appear more often). Options: gender, culture/region, name format (first-last, last-first, with middle).
Populate test databases with realistic user names.
Fill interface designs with sample user data.
Show realistic data without using real people.
Replace real names with fake ones for anonymization.
const firstNames = [
'James', 'Mary', 'John', 'Patricia', 'Robert', 'Jennifer',
'Michael', 'Linda', 'William', 'Elizabeth', 'David', 'Susan'
];
const lastNames = [
'Smith', 'Johnson', 'Williams', 'Brown', 'Jones', 'Garcia',
'Miller', 'Davis', 'Rodriguez', 'Martinez', 'Wilson', 'Anderson'
];
function randomName(options = {}) {
const first = firstNames[Math.floor(Math.random() * firstNames.length)];
const last = lastNames[Math.floor(Math.random() * lastNames.length)];
if (options.format === 'last-first') {
return `${last}, ${first}`;
}
return `${first} ${last}`;
}
// Generate array of unique names
function randomNames(count) {
const names = new Set();
while (names.size < count) {
names.add(randomName());
}
return [...names];
}
randomName(); // "Jennifer Brown"
randomNames(5); // Array of 5 unique namesRandom selection from name pools. Track for uniqueness in batch generation.
Use random name generator for test data, UI mockups, demos, and development. Never use generated names as real user data in production.
Pseudo-random from curated pools. Names are real but combinations are random. Weighted selection makes common names appear more often, like real populations.