With the new profile pages, I can now see my own and other users' rare accomplishments in the rarest badges section.

This led me to be curious about exactly how rare these rare badges are.

Would it be a lot of work to display the percentage of users on the site (perhaps only calculating with users who have 200+ reputation) that have that badge next to each rare badge? Or as part of the pop-up info that appears when you hover the cursor over the badge? I have a feeling some of my gold badges aren't actually as rare as some of the silver ones.

No, I don't have any pressing need for this feature. No, it isn't solving anything that I couldn't tediously calculate on my own for every time I look at someone's profile summary. I just think it would be nice.

EDIT: To highlight the significance of this information, according to the query in the answer below I have eleven badges that are rarer than my rarest gold badge on Mi Yodeya. My rarest badges are actually my bronze badges.


1 Answer 1


If this feature is not implemented (or in a more optimistic tone - until it is), you can use this Data Explorer query to get this information.

This query takes two parameters:

  1. The ID of the user you want to check badge rarity for (presumably yours)
  2. A minimum reputation cap. Users below this reputation cap are excluded, as are their badges.

This query calculates two types of rarity:

  1. "% of all users" is the percentage of users with this badge, out of the total users, regardless of the badge count. For example, consider a site with 100 users, where only two users have badges - you have a million "Good Answer" badges and Mr X has a single Informed badge. Both badges are as rare by this standard, since only 1% of the users have either.

  2. "% of all badges" is the percentage of this badge out of the total number of badges given on the site. Note that this percentage is based on how rare the badge is and disregard the number of such badges you have. For example, let's assume that the Great Answer badge is the rarest on the site - out of 300 badges given on the site, there are only 3 Great Answers - two by you and one by Mr. X. Both your reports will show this as the rarest badge, comprising of only 1% of the site's badges. The fact that you have two and he only has one is inconsequential.

Note that this query was created for Stack Overflow, but could easily be changed to any other site in the Stack Exchange Network.

  • 1
    Interesting - I didn't consider the second way to calculate it, but it makes sense as well. Commented Nov 24, 2015 at 1:34
  • I think there is something wrong with your second calculation - the entire column comes back with the same percentage. Commented Nov 24, 2015 at 1:38
  • @yEz yes, you're correct, I see my bug now. I've fixed the query and updated my answer with a link to the revised one.
    – Mureinik
    Commented Nov 24, 2015 at 5:15
  • There's a quirk in the sorting; STR's length parameter needs to be increased by one to avoid sorting 12.x% before 2.x%. Commented Jan 28, 2016 at 6:31
  • @NathanTuggy nice catch, thanks! Actually, it should probably be increased by two, as theoretically you could find a set of parameters in which all the users have a certain badge. I've updated the query accordingly.
    – Mureinik
    Commented Jan 28, 2016 at 8:11
  • 1
    The query can just be copied, the site chosen on the top right and pasted, it works fine then. Tested for gamingSE. Commented May 6, 2019 at 23:36
  • @FabianRöling no need to copy-paste - there's a change site dialog box on the bottom left corner you can use to choose and run this query on any SE (including meta and beta) site you want.
    – Mureinik
    Commented May 7, 2019 at 8:17
  • @Mureinik That cleared the script text field for me. Might have been because I clicked "fork query" first. Commented May 7, 2019 at 9:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .