A recent Twitter crackdown on 'locked' accounts meant that high-profile users lost millions of followers overnight.

Katy Perry, Justin Bieber and Barack Obama each lost more than two million followers overnight.

Donald Trump's following looks relatively unscathed.

Celebrity accounts on Twitter have seen a big drop in numbers overnight, thanks to a rule change by the company.

Twitter announced on Wednesday that it would no longer include "locked" accounts in follower numbers in an effort to boost user trust in the service. Twitter locks accounts when they display a sudden change of behaviour, like sending lots of unsolicited replies.

According to social media analytics service Socialblade, the nine biggest Twitter accounts — Katy Perry, Justin Bieber, Barack Obama, Rihanna, Taylor Swift, Lady Gaga, Ellen Degeneres, Christiano Ronaldo and YouTube — all saw drops of more than 2 million followers each.

Here's Katy Perry's follow count — check out the sudden drop at the end:

Katy Perry's followers dropped by 2,816,619 on Friday. Social Blade

The size of the drops were not directly correlated to the amount of initial followers. Justin Timberlake rounds out the top 10 accounts with the biggest followings, but he's lost around 1.8 million overnight.

Meanwhile Britney Spears (14th in terms of followers) did lose more than 2 million, and Twitter's own corporate Twitter account (16th) lost more than 7 million.

Here's Twitter's follower count according to SocialBlade:

Twitter saw the largest drop of all with 7,731,910. Social Blade

The most popular accounts have more than 100 million followers, and Donald Trump is far down the list with 53.1 million. His follow count remains relatively unscathed. He lost just 326,118 followers on Thursday, the day before most accounts saw a drop, and on Friday he regained 5,339 followers.

Here's Donald Trump's follow count:

Trump had a small loss on Thursday, but started regaining followers on Friday. Social Blade

Although losing 2 million followers is undoubtedly a significant drop, proportionally speaking it's not necessarily huge. Katy Perry started off with 109 million followers, and a 2.8 million drop represents a decline of approximately 2.6%. Twitter initially warned that its culling of fake followers would affect about 6% of all follows, so Perry actually may have got off lightly.