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.

  • 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
    Commented Feb 16, 2016 at 19:06
  • Your answer points to a solution for finding the gender of a name, not the nationaity.
    – johan855
    Commented May 10, 2016 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/… Commented May 11, 2016 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
    Commented May 11, 2016 at 16:54
  • I saw this the other day: namsor.com Haven't tried it myself.
    – jrc
    Commented Nov 9, 2018 at 9:12

2 Answers 2


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).

  • As written in the Repo, Baby names contains US data. But the questioner is interested in global data with surnames as well.
    – Alok Nayak
    Commented Apr 8, 2021 at 8:36

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.