Skip to main content
Gender API
Get Free API Key

Method & Accuracy Guide

How to infer gender from a name: methods, accuracy and pitfalls

A first name says a lot about gender and nothing for certain. Here are the four ways to turn one into the other, how to measure error rates on your own names, and the cases that catch everybody out.

  • 100 free lookups / month
  • Probability + sample count on every answer
  • EU servers in Germany · DPA available

Last reviewed 2026-12-05 Written and maintained by the Gender-API.com team

  • 193 Countries in database
  • 0.0 – 1.0 + Samples Auditable cut-offs per row
  • 100 / request Batch names in one POST
  • EU / Germany German servers & GDPR DPA

The short answer

  • Look the name up in counted records for the country the person lives in. You get a gender, a probability and a sample count — Andrea is male in Italy and female in Germany.
  • Judge any method by what it does with a name it does not know. An honest "unknown" can be filtered; a confident guess cannot be spotted.
  • Measure accuracy on a few hundred of your own names, and score right, wrong and no answer separately. Then pick the probability cut-off that leaves an error rate you can live with.
  • Use the result for counts and salutations, not for decisions about a person. It describes the name, not the person carrying it.

Approaches

Four ways to infer gender from a name

Every tool in this space is one of four methods, or a mix of them. On common names they mostly agree. They come apart on the rest — and on a real customer list or author list, the rest is where the work is.

The same name asked four ways. A fixed name list returns one label, and unknown for a name it does not hold. A model trained on spellings returns a label and a score for any string, including names it has never seen. A language model returns a sentence that can differ between runs. Counted records return, per country, a gender, a probability and a sample count — Andrea is male in Italy and female in Germany — and a low sample count or an explicit not found for an unknown name.
The mechanism, not a measurement — the record counts are one example response.
  • A fixed name list

    Fast, offline and free. It returns one label per name, so there is nothing to set a cut-off on, and it knows only the names somebody wrote into it.

  • A model trained on spellings

    Learns that names ending in certain letters lean one way. It answers for any string, which is its strength and its risk: a typo or a company name still gets a gender.

  • A language model

    Good at explaining a single name, weak at the same answer for the same name every time, and it shows no count to check against. Gender-API vs. ChatGPT goes through that trade in detail.

  • Counted records

    The share of people with that name who are male or female, per country, with a sample count that shows how much data the answer rests on. This is how Gender-API answers, with data from 193 countries.

Localization

Why the country changes the answer

Andrea is a man's name in Italy and a woman's name in Germany. Nicola is male in Italy and female in Britain. A method that gives one answer per name worldwide is wrong for one of those countries every time, and the error does not look like an error — it looks like a confident label.

So send the country whenever you know it: from the address, the shipping country, the phone prefix or the institution. Where you do not, a browser locale or an IP address is a reasonable stand-in. And keep the country of the person apart from the origin of the name — someone called Andrea who lives in Munich is most likely a woman, whatever the name's Italian roots suggest.

Evaluation Protocol

How to measure accuracy on your own names

A percentage measured on somebody else's names tells you about their names. The test that tells you about yours takes an afternoon:

  • Take a few hundred names from your own data whose gender you can confirm by hand — and include the ones you expect to be hard.
  • Run them through every method on your shortlist, with the country where you have it.
  • Score three outcomes, not two: right, wrong, and no answer. A method that always answers never shows a "no answer" — its doubtful cases are spread over right and wrong instead.
  • Raise the probability cut-off step by step and watch wrong answers turn into "held back". Stop where the remaining errors are acceptable for the job.
  • Write down the cut-off, the share left unknown and the error rate together. Any one of them alone can be made to look good.
499 hand-checked author names, scored two ways. Taking every answer: 11 names got no answer, 466 were right and 22 were wrong. Taking only answers with a probability of at least 0.80: 11 no answer, 435 right, 46 held back for review and 7 wrong. The cut-off turned most of the errors into a short list a person can check.
Figures from one independent check of 499 author names (J. Hagberg, February 2025). One name set, not a benchmark — the method is the point, not the percentage.

That is what the chart shows. A sports-physiology researcher, asked by journal reviewers to justify using Gender-API for an authorship study, checked 499 author names by hand against photos and pronouns online. Taking every answer, 22 of the 488 answered names were wrong. With his study's cut-off of 0.80, 7 were — and 46 were held back as unknown instead of being counted. The full two-page report is public.

Read those numbers for the method, not as our accuracy. They come from one person and one set of mostly uncommon names. We do not publish an accuracy figure of our own — how to choose a gender API explains why, and which questions to ask of anyone who does.

Data Quality

The pitfalls

Most errors on a real list do not come from the lookup. They come from what is in the name column before the lookup starts.

Common name-column pitfalls and how to handle each before or during lookup
Pitfall What goes wrong What to do
Unisex names Kim, Jordan or Andrea get a label either way Send the country; leave what stays near 50/50 unknown
Family name first In Chinese, Japanese, Korean or Hungarian order the first word is the surname Use a full-name lookup that finds the first name instead of taking the first word
Initials and titles "J. Smith" has no first name to look up; "Dr" is not one Strip titles first and count initials as unknown, not as errors
Thin evidence A confident probability can rest on a handful of records Set a minimum sample count next to the probability cut-off
Not a name at all Company names, "info@" addresses and test rows reach the lookup Prefer a method that says "not found" over one that always answers
Only an e-mail address "jsmith84@" hides the name; "julia.smith@" does not Use an e-mail lookup that extracts the name, and expect more unknowns

Ethics & Compliance

What a name cannot tell you

An inferred gender is a statement about a name: most people called Sandra whose gender is on record are women. It is not a statement about the Sandra in row 4,812, and it has no way to represent anyone who is neither a man nor a woman.

  • Use it for aggregates — authorship studies, pay-gap and diversity reporting, audience analysis — where individual errors average out and the error rate can be stated.
  • Use it for salutations with a neutral fallback for everything below your cut-off, so nobody gets the wrong "Dear Mr".
  • Do not use it to decide anything about an individual — a price, an offer, an application.
  • Where it matters, ask people. A self-stated gender always overrides an inferred one.

Reproducible Reporting

What to write in the methods section

If the gender data goes into a paper, the reviewers will ask how it was made. Five lines answer them:

  • The method or service, and the date of the lookups.
  • Whether a country was sent with each name, and where it came from.
  • The probability cut-off and the minimum sample count.
  • The share of names left unknown, and whether they were dropped or reported as a group.
  • How the error rate was checked: sample size, how the sample was labelled, right/wrong/unknown counts.

Both probability and sample count are already in every output

For an author list, upload a CSV or Excel file; for a pipeline, see gender from names in Python or the API reference.

FAQ

Frequently asked questions

How do you infer gender from a first name?

By looking the name up in records of people whose gender is known, and returning the share that is male or female — ideally for the country the person lives in, because the same name can go either way in different countries. The alternatives are a fixed name list, a model trained on spellings, or asking a language model. They differ most in what they return for a name they do not know.

How accurate is inferring gender from names?

It depends on the names more than on the method. Common names in their own country are easy; rare, transliterated and unisex names are where errors come from. The only figure that describes your case is the one you measure on a few hundred of your own names, scoring right, wrong and no answer separately.

What confidence cut-off should I use?

The one your own labelled sample supports. Raise the cut-off and the wrong answers go down while the number of names you hold back goes up; pick the point where the remaining errors are acceptable for your use. Set a minimum sample count as well, because a confident answer resting on a handful of records is still thin.

How should unisex names be handled?

Send the country when you know it — many names are unisex only across borders, not within one. What stays near 50/50 after that should be left unknown or reviewed, not forced into a label. A probability makes those rows easy to find.

Is it ethical to infer gender from names?

For aggregate questions — how many authors in a journal are women, whether a campaign reaches its audience — it is an established method. It is the wrong tool for deciding anything about an individual: the result describes the name, not the person, and it cannot represent anyone outside a binary label. Give people a way to state their own gender wherever it matters.

What should a research paper report about the method?

The service or method and the date of the lookups, whether a country was sent, the cut-off and minimum sample count, the share of names left unknown, and how you checked the error rate on a hand-labelled sample. Reviewers ask for exactly these.

Run the test on your own names

100 free lookups every month — enough for the labelled sample above. Names we do not find cost nothing.

Chat