I built Teenagers Population to fill a gap in publicly available demographic data. While plenty of statistics exist about overall populations, detailed information about teenage demographics is surprisingly hard to find! And there's many people that would like to know it.
I combine multiple data sources including birth records, survival rates, timezone mappings, and seasonal patterns to create accurate, minute-by-minute tracking of teen populations worldwide. And since it's the only site doing this. It's the most accurate.
This project is part of Escaping Work, my website!
I start with annual birth records that gives me the raw numbers of how many people were born in each country each year.
Then I distribute those births throughout the year using daily percentages and throughout each day using hourly patterns.
I account for infant mortality by adjusting the counts based on each country's survival rates, and I handle timezone differences so the calculations are accurate worldwide as birthdays happen at different local times.
The system tracks three groups: people who have just turned 13 (entering teens), people who haven't turned 20 yet (still teens), and everyone in between ages 14-18.
What defines a "teenager"? I define teenagers as people aged 13-19. Someone enters their teenage years when they turn 13, and leaves when they turn 20. But I use exactly 20 years after birth, including time.
Why do the numbers change at different rates? Later in the year, only sparsely populated Pacific islands remain, slowing the rate dramatically.
This site was gonna be WAY too expensive if I wanted to make it realtime and still have full data accuracy. So instead of WebSocket connections, I pre-compute 60 seconds of data every minute and serve it via jsDelivr CDN.
Cost avoidance: Traditional real-time systems cost linearly with users (1000 users = 1000 persistent connections). My system costs the same whether serving 1 user or 1 million users.
Data optimization: I use array indices for country data instead of repeating country names, shorten property names, this helped keep the JSON files smaller, from 423 KB to 86 KB.
Smart prefetching: Clients automatically download the next data block 30 seconds before they need it, ensuring smooth continuous updates without any interruptions.
Have questions or suggestions? I'd love to hear from you!
Send me an email at [email protected] or visit Escaping Work to see more options!