To create a name generator, pair word lists with rules and random picks, then filter results by length, tone, and uniqueness.
People search for a name when they’re stuck. A character needs a believable surname. A game needs hundreds of NPC handles. A new app needs something short that’s not taken. A classroom project needs a pile of practice data. In all of those cases, a name generator saves time, keeps you consistent, and gives you options without staring at a blank page, less fuss.
This guide shows you how to build one that feels like it has taste, not randomness. You’ll set up word banks, write a few simple rules, add filters that catch awkward results, and test outputs so you can trust what it produces.
Name Generator Styles And What To Prepare
| Generator Style | Inputs You Prepare | Checks Before You Use A Result |
|---|---|---|
| Fantasy Character Names | Syllables, prefixes, suffixes, setting-style phonetics | Say-it-out-loud flow, no tongue twists, fits the setting |
| Business Or Brand Names | Core words, benefits, short modifiers, category terms | Trademark search, domain check, easy spelling |
| Usernames And Handles | Nouns, verbs, numbers policy, separators, taboo list | Availability, no confusing characters, no accidental meaning |
| Baby Name Lists | Name bank, origin tags, syllable counts, initials rules | Initials read clean, easy pronunciation, family constraints |
| Pet Names | Short words, sounds pets react to, theme words | Two-syllable test, no overlap with commands |
| Project Code Names | Animals, places, colors, verbs, internal themes | Not rude, not confusing with other projects, easy to say |
| Item Or Loot Names | Adjectives, materials, powers, rarity tags | Readable at a glance, no repeats, scales with rarity |
| Test Data Person Names | First names, last names, locale sets, formatting rules | Avoid real people in your org, match format needs |
What A Name Generator Does
A generator has three jobs. First, it creates candidates. Second, it rejects weak ones. Third, it gives you a clean way to steer results toward a theme. When you build it with those jobs in mind, you get names that feel intentional.
Random picks alone can turn messy fast. A good generator uses randomness inside guardrails. That means you decide what parts can vary, what parts must stay stable, and what “bad outputs” look like in your niche.
The Three Building Blocks
- Word banks: the raw material, stored as lists or tables.
- Rules: patterns for how parts combine.
- Filters: quick checks that remove awkward results.
Inputs That Make Results Feel Real
Start with the pieces you can reuse. A small, well-chosen bank beats a huge grab-bag full of mismatched tones. You can always expand later once you see what patterns you like.
Word Banks That Stay Useful
Build a few lists that match the vibe you want. For brand names, you might keep one list for core nouns and another for short modifiers. For character names, keep syllables that share a sound family, so mixes still sound like they belong together.
Try to tag words with simple labels you can filter on: length, syllable count, soft vs sharp sounds, or category. Tags keep variety without chaos.
Patterns That Keep Names Consistent
Patterns are templates. They can be as simple as “modifier + noun” or as detailed as “prefix + vowel + suffix.” A short set of templates is plenty. You can weight them so the generator favors your best patterns more often.
Template Ideas You Can Start With
- Modifier + Noun: “Quiet Harbor”, “Copper Finch”
- Noun + Noun: “Stone Bridge”, “Pixel Garden”
- Prefix + Root + Suffix: “Cal + dor + en”
- Verb + Noun: “Chase Signal”, “Forge Star”
Building Your Own Name Generator With Lists And Rules
Pick a format that matches where the generator will live. A spreadsheet version works for quick classroom work. A web version works for public tools. A script works for game dev pipelines. The logic stays the same either way.
Step 1: Choose The Output Shape
Write down what a “good name” looks like in one sentence. Keep it concrete. “Two words, 4–12 letters each, easy to spell” is clear. “Sounds cool” is too vague to code.
Step 2: Build A Simple Scoring Rule
Instead of a hard pass/fail list, add a tiny score. Give points for what you like and subtract points for what you don’t. Then you can keep the best out of a batch and ignore the rest.
- +1 if total length is within your range
- +1 if it avoids repeated letters like “aaa”
- +1 if it avoids hard-to-read mixes like “qz”
- -2 if it contains a banned substring
Step 3: Use Real Randomness
If your generator runs in a browser, use the Web Crypto API for randomness, not Math.random. On the server, use the platform crypto module. This keeps outputs less predictable and avoids patterns that show up in long runs.
Here’s a tiny JavaScript pick helper that pulls random bytes from crypto.getRandomValues and maps them to an index.
function pick(list) {
const buf = new Uint32Array(1);
crypto.getRandomValues(buf);
const idx = buf[0] % list.length;
return list[idx];
}
If you’re using Node.js, the Node.js crypto module gives you similar primitives for safe randomness.
Step 4: Add Filters That Catch Bad Outputs
Filters are cheap. Run them early, run them often. Your first filters should catch the most common “nope” cases in your niche: weird spacing, double separators, or names that start or end with a dash or underscore.
Next, add a pronunciation sanity check. You don’t need a full phonetics model. Simple rules catch a lot: avoid three consonants in a row, avoid repeated vowels that look like typos, and block letter pairs that read harsh in your target language.
Create A Name Generator
If your goal is a generator that people will keep using, give them control without making them think. Sliders for length, toggles for one-word vs two-word names, and a theme selector can do a lot.
Start with defaults that produce good results right away. Then add controls for edge needs: “no numbers,” “allow hyphens,” “start with a vowel,” or “match this prefix.” The tool should feel friendly even when the settings get strict.
Step 5: Make Variants Without Rewriting Everything
Variants come from swapping one bank at a time. Keep your templates steady, then swap the words. One bank for sci-fi, one for cozy crafts, one for serious business. The same engine can serve all of them.
Weights help too. If you have 10 templates and only 3 feel right, weight those 3 higher and let the others show up once in a while for spice.
Step 6: Guard Against Duplicate Names
Duplicates are the silent killer of a generator. Store a set of names you’ve already emitted in the current session and redraw if you hit a repeat. For bigger runs, store a hash so you can check repeats fast.
Also block near-duplicates. “Stone Bridge” and “Stonebridge” feel like the same idea. You can normalize output by removing spaces and punctuation, then compare.
Quality Checks That Keep Results Usable
Even a small tool can ship with checks that save real time. Run these checks in batches. Generate 500 names, then scan the worst ones. Each time you spot a pattern you dislike, add one more rule. After a few passes, the generator feels dialed in.
Readability is the big one. If a reader can’t spell it after hearing it once, it’s a weak pick for brands, usernames, and class materials. If it’s a fantasy name, you get more room, yet it still needs a mouth-feel that works.
Filtering Rules You Can Reuse
- Trim spaces and collapse double spaces
- Block leading or trailing separators
- Block repeated separators like “__” or “–”
- Block banned word parts, even inside longer strings
- Limit repeated letters to two in a row
- Enforce min and max character counts
Testing And Tuning Without Guesswork
Testing is simple: generate a big batch, then sort it by your score. Scan the top 30 and the bottom 30. The top list tells you what to keep. The bottom list tells you what to block.
Don’t chase perfection. Aim for a high hit rate, like “I’d save one out of five.” That’s plenty for a tool that can spit out hundreds of options in a minute.
Batch Test Table
| Test | How To Run It | Pass Signal |
|---|---|---|
| Uniqueness In Session | Generate 1,000 names, count repeats | Repeats near zero after normalization |
| Readability Scan | Read 50 out loud, write what you hear | Most spellings match on first try |
| Length Distribution | Plot lengths, check tails | Few names outside your target band |
| Template Balance | Count outputs per template | No single template floods the set |
| Taboo Filter | Search outputs for banned parts | Zero hits across the full batch |
| Near-Duplicate Check | Normalize and compare with a set | Similar strings stay rare |
| Theme Fit | Mix in 10% random “wild” words | Oddballs still fit your voice rules |
Practical Builds For Popular Use Cases
Once your core engine works, you can tailor it fast. The trick is to change the banks and filters, not the whole design.
Business Name Generator
Keep names short. Prefer two words. Avoid jargon-y tech mashups unless your audience expects them. Add a filter that blocks tricky spellings and another that blocks words that feel generic in your category.
Fantasy Name Generator
Use syllables and a few phonetic rules. Keep vowel balance in mind so names don’t turn into consonant piles. Add optional endings for gendered or clan-like styles if your setting uses them.
Username Generator
Start with a noun bank plus a verb bank. Add a short-number option that keeps digits at the end, not sprinkled inside. Block look-alike characters, like “l” vs “I”, when the handle needs clarity.
Classroom Data Name Generator
Use locale sets so names match the region you’re teaching about. If the data will be public, avoid real student names and avoid pulling from staff lists. A clean rule set keeps outputs respectful.
Copyable Checklist For Launch Day
Before you publish or share, run this quick list. It keeps your tool stable and your outputs clean.
- Run 1,000 outputs and skim the worst 50
- Check duplicates after normalization
- Confirm min and max length filters
- Confirm spacing and separator rules
- Search for taboo parts with a case-insensitive scan
- Try three themes and confirm each still feels coherent
- Save your word banks in a versioned file so edits stay tracked
Where To Take It Next
Once you’ve shipped the first version, your best upgrades come from real use. Collect the names users save and the names they skip. That feedback points you to new word banks and better weights.
If you want to build one for a niche like tabletop factions or product SKU labels, create a name generator that follows rules the niche already uses. Then add one small twist that gives your outputs their own flavor.