This question already has an answer here:

I'm building an application where I will need to sort a persons nationality according to his/her name, is there any such dataset for this somewhere?

It would be great to have something like:

Name Country Pierre France Carlos Spain Carlo Italy . . .

I know names are very subjective but an approximation can be made, even if only from the European Union or China would be good.

marked as duplicate by philshem, Community Feb 16 '16 at 20:46

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    In particular, the resource in my answer is curated, clean, international and exhaustive (40k+) with country distributions opendata.stackexchange.com/a/4757/1511 – philshem Feb 16 '16 at 19:06
  • Your answer points to a solution for finding the gender of a name, not the nationaity. – johan855 May 10 '16 at 23:22
  • Actually the answer noted by @philshem does indicate both gender and nationality (based on country and popularity). This does seem to provide the answer you are looking for: opendata.stackexchange.com/questions/4756/… – Jeanne Holm May 11 '16 at 13:38
  • It does mention it, but it's not useful since the dataset does not provide an accessible way to check for the nationality of the name, the nationality in this case is only used to check if a specific name for a specific country is masculin or feminine, so for example, know if "Tracy" in the united states is more of a female or male name, please read throughly the explanations before judging if it is actually useful. – johan855 May 11 '16 at 16:54
  • I saw this the other day: namsor.com Haven't tried it myself. – jrc Nov 9 '18 at 9:12

Check out the "babynames" R package by Hadley Wickham. The package does not contain R code, but a 2-million row dataset.

The author has published several cool tutorials based on this dataset.

If you don't know R, you can still check out the linked sources on that page, to get to the raw data (from the US Social Security Administration).

The data does not contain "country of origin" though.

however, you could augment this dataset yourself, e.g. by scraping Wikipedia for the given-names that interest you (maybe there is a better way).


I think screen scraping would work fairly well. Choose a few websites, like babynamewizard.com. These often only give you current popular names, but there are web pages also within the same site that give interesting hisorical perspectives allowing a fuller list of names to be obtained.

An additional advantage is that you can keep your dataset up to date with current "new names".

I guess a complication will be collecting data in the various native alphabets also - Cyrillic, Greek, etc. You would need to use extended ASCII for that.

Not the answer you're looking for? Browse other questions tagged or ask your own question.