How the X algorithm works, from its published code
Updated
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:
- In-network: recent posts from accounts you follow.
- Out-of-network: posts from accounts you don't follow, found by retrieval models, plus a shared list of popular recent posts.
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 action | Default weight |
|---|---|
| Share by copying the link | 20 |
| Reply | 5 |
| Quote | 5 |
| Share by DM | 5 |
| Follow the author | 4 |
| Share | 2 |
| Repost | 1 |
| Like | 0.66 |
| Click the post | 0.3 |
| Open a link | 0.2 |
| Dwell on the post | 0.05 |
| Click the profile | 0 |
| Video quality view | 0 |
| 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:
- Author diversity: each extra post from one author in a feed gets a decaying multiplier.
- Out-of-network discount: posts from accounts you don't follow are multiplied by a factor below 1. So are replies and reposts from accounts you do follow.
- New-author lift: under the published defaults, an original post can move toward a set position if it's under two hours old, has under 200 impressions, and its author has 50,000 followers or fewer.
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
- Exact model behavior. The weights are public, but what the model predicts for a given post depends on training data and on each viewer's activity.
- Who's in which test. Some values change by experiment group.
- The reordering service. The README says a separate service reorders results after scoring. That means the score isn't the final word.
- Your own results. Check your numbers with our engagement rate calculator, since no public code can predict them.
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.