4

Is there a simple way to see the total amount of users on Stack Exchange? I ran a query on data explorer, but it looks like it's only Stack Overflow. Adding up every community would be tedious and I would probably get a lot of duplicates. Are these stats available for the whole network somewhere?

More specifically, is it possible to run queries on all sites at once?

4
  • You could try bribing a community manager or dev in chat. I think they can run queries cross site. – AJ Henderson Apr 6 '14 at 5:06
  • 1
    @AJHenderson With... what? Cookies? Hugs? Unicoins? :P – Blue Ice Apr 6 '14 at 5:12
  • The following page says 5.2 million, presumably it would be all sites: stackexchange.com – PeterJ Apr 6 '14 at 5:26
  • I'm assuming that's a rounded number ;-) – curious Apr 6 '14 at 5:28
8

The accurate number of both registered and unregistered users in all of Stack Exchange network at the moment of writing the answer is: 5,178,736.

How did I find it? JavaScript. Yep. In the All Sites list, open up a console and run the following code:

var totalUsers = 0;
$(".lv-stats-box:contains('users')").each(function() {
    totalUsers += parseInt($(this).find(".number").find("span").first().attr("title").replace(/\,/g, ''));
});
console.log(totalUsers);

Note that the per site Users page (e.g. Stack Overflow users) show only registered users so it's also a way to calculate amount of unregistered users per site. For example on Stack Overflow, there are 75204 pages of users, 36 in each page resulting in about 2707344 registered users. On the sites list it says "2,990,649 registered and unregistered users" so it means 283,305 unregistered user accounts.

4
  • Amazing! Are you aware if this counts duplicates? (i.e. if I have an account here and in graphic design and other places, am I repeated on the list?) – curious Apr 6 '14 at 15:43
  • I fear you are repeated. :-) – Shadow The Vaccinated Wizard Apr 6 '14 at 16:49
  • 1
    +1 because your answer is a little more accurate than mine :) – Blue Ice Apr 6 '14 at 17:26
  • 2
    @Emilie on a second thought, maybe we can use the API to get exact count without duplicates... stay tuned! – Shadow The Vaccinated Wizard Apr 6 '14 at 17:34
5

You can run this SEDE query. It unions all Users tables across all databases taking only the accountid. The accountid is the unique id for a single registered user across the network. Everyone has one. If you take the distinct count of the accountid you'll get the exact number of registered users. Worth mentioning that unregistered users do exist as sll but those can't be found in SEDE.

declare @sql nvarchar(max)

select @sql = 
concat(
'select format(count(distinct accountid),''#,###'') [total accounts] from (',
string_agg(concat(
N'
select accountid 
from ', convert(nvarchar(max),quotename(name)), N'.dbo.users'
)
,N' union all ')
, ') data')
from sys.databases
where database_id > 5

exec (@sql)

When run today it returns a number of 17,727,728 registered accounts.

Keep in mind SEDE is updated once a week on Sunday.
Let's praise the kind Monica Cellio for the awesome SEDE Tutorial she wrote.
Say "Hi" in SEDE chat.

4

Try the front page, it says that there are 5.2 million users currently:

enter image description here

2
  • I think I see a freehand circle – curious Apr 6 '14 at 5:31
  • 6
    @Emilie Nope, that was definitely the circle tool. :P – Blue Ice Apr 6 '14 at 5:32

You must log in to answer this question.

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