Blog

How the X algorithm works, from its published code

X builds your For You feed fresh on each request. It collects posts from people you follow and people you don't, predicts how likely you are to act on each one, combines those predictions into a score, then adjusts and filters the list. X publishes this code in its x-algorithm repository, so you can check most claims yourself.

We read commit b220448 on November 3, 2026. The values below are the published defaults. X runs live tests that can change them for some people, and the code can change at any time.

Where posts come from

The README names two sources:

Both groups are ranked by the same model. That model reads your recent activity, so two people can get very different scores for the same post.

How a post gets scored

The README gives the formula: the final score is the sum of each predicted action times its weight. So the model estimates the chance that you'd reply, like, block and so on, and each estimate is multiplied by a number from the parameters file.

Predicted actionDefault weight
Share by copying the link20
Reply5
Quote5
Share by DM5
Follow the author4
Share2
Repost1
Like0.66
Click the post0.3
Open a link0.2
Dwell on the post0.05
Click the profile0
Video quality view0
Not interested-52.272
Block the author-31.2
Mute the author-58.8
Report-234

Two rows surprise people. Profile clicks and video quality views have a default weight of 0, even though many guides treat them as key signals. Other parts of the system can still use those actions, so a zero here doesn't make them useless.

How not to read those weights

The weights multiply predictions. They don't multiply counts. X's code comments spell this out: it's wrong to say one report cancels 468 likes, because a report is predicted to be more than 1,000 times rarer than a like.

The same logic applies to "a reply is worth 7.5 likes." Rare actions get bigger weights so that they can affect the score at all. The table tells you what X's system values. It doesn't give you an exchange rate.

What happens after scoring

The README lists three adjustments, then a separate service that reorders the result:

Some posts never get that far. The filter list removes posts older than 48 hours, and it removes replies from accounts you don't follow under the default settings.

Whether a post can be shown at all is decided separately, using your own blocks and mutes plus labels from other systems. If you suspect a label is hurting you, see how to check for a shadowban.

What this means for a small account

These are our readings of the code, not rules from X.

Write for one kind of reader. Ranking is personal, so a post that fits a narrow group can do well with them. Vague posts for everyone give the model little to predict from.

Ask for real responses, and don't bait them. Replies, quotes and shares have high weights, and "not interested" has a large negative one. A post that wins a few clicks and annoys many readers may not be a good trade.

Talk with people who follow you back. In July 2026, X added a boost to predicted replies on original posts from mutual follows. The parameters file now sets it to 15 by default.

Use replies to reach a thread, not the feed. Since the filter removes most replies from strangers' For You feeds, your reply mainly reaches people already reading that conversation. Our reply strategy guide covers how to use that.

Stay around after you post. The new-author lift depends on a post being fresh with few impressions, and your first replies are the conversation other readers see.

What the code can't tell you

If someone gives you a formula with a promised result, ask which file it came from. To turn this into a daily habit, Repli's demo shows a sample morning plan on an invented account.

Share this article on X

Keep reading