X Algorithm: How the X (Twitter) For You Feed Works and How to Grow

5Feed-building stages
5Signal types
9Growth tips
48hCandidate window in the code
How the X algorithm works: candidates, predictions and ranking

The X algorithm is the recommendation system that decides which posts appear in your For You feed on X (formerly Twitter): it gathers candidate posts from accounts you follow and accounts you don’t, predicts how likely you are to engage with each one, and ranks them by a weighted score. X has published much of the code behind this system on GitHub, which gives marketers an unusually clear view of what the algorithm rewards: posts people read, reply to, repost and click, and not posts that make people mute, block or scroll past. This guide explains how the X algorithm works, the ranking signals that matter, what hurts reach and practical ways for brands and creators to grow on X.

Key Takeaways

  • X’s open-source repository describes the For You feed as “assembled per request” from in-network posts (accounts you follow) and out-of-network posts.
  • A transformer-based model called Phoenix predicts the probability of many actions, such as likes, replies, reposts, clicks and dwell time, and the system combines them into a weighted score.
  • Negative signals, including “not interested”, mutes, blocks, reports and not dwelling on a post, are also predicted and reduce a post’s chances.
  • Filters remove duplicates, posts from blocked or muted accounts, posts already seen and, according to the code, posts older than 48 hours from the main candidate pool.
  • X notes that some files are withheld and live settings may differ from the published defaults, so the code is a guide, not a guarantee.
How the X algorithm works: candidates, predictions and ranking
How the X algorithm builds the For You feed

What Is the X Algorithm?

X has two main home feeds. The Following feed shows posts from accounts you follow, mostly in chronological order. The For You feed is algorithmic: it mixes posts from accounts you follow with recommendations from accounts you do not, ranked by how relevant and engaging the system predicts they will be for you. When marketers talk about “the X algorithm”, they usually mean the system behind the For You feed, plus related systems that rank replies, search results and notifications.

Unlike most social platforms, X has published a large part of its recommendation code, first when it was still called Twitter and later in a new repository describing a system built on the same transformer architecture used by xAI’s Grok models. This means many claims about the algorithm can be checked against the code rather than guessed. However, X states that some parts are withheld to reduce gaming and that live weights may differ from the defaults in the code.

What Most X Algorithm Guides Miss

Many guides list tricks, such as posting at a magic time or using certain words. Three points matter more:

  • The algorithm predicts behaviour, not quality. It ranks posts by how likely each person is to engage or pay attention. The best strategy is to create posts your specific audience genuinely wants to read, reply to and share.
  • Negative signals count. Posts that make people mute, block, report or quickly scroll past are penalised. Clickbait and spammy tactics can hurt more than they help.
  • Freshness matters. The published code filters out older posts from the main candidate pool, so content has a short window. Consistent posting matters more than occasional viral attempts.

How the X Algorithm Works

Based on X’s published repository, building your For You feed happens in several stages every time you refresh.

Stage 1: Finding candidate posts

The system first gathers a large pool of posts you might be interested in, from several sources:

  • In-network posts: recent posts from accounts you follow, supplied by a component the code calls Thunder.
  • Out-of-network retrieval: a model represents you and posts as vectors (lists of numbers that capture interests) and finds posts “near” your interests from accounts you do not follow.
  • Community clusters: a system called SimClusters groups accounts and posts by who engages with them, helping surface posts popular within communities you belong to.
  • Popular posts: a shared list of recent posts that are performing well.

Stage 2: Filtering

Before scoring, filters remove posts that should not appear: duplicates, posts you have already seen, your own posts, posts from accounts you have blocked or muted, posts containing your muted words and, according to the published code, posts older than 48 hours. Separate visibility rules then decide whether a post can be shown normally, shown with a notice or warning, or dropped, for example for safety or legal reasons.

Stage 3: Predicting engagement

A transformer model called Phoenix looks at each candidate post and your history and predicts the probability of many different actions, such as liking, replying, reposting, quoting, sharing, clicking, watching a video, spending time reading, visiting the author’s profile and following the author. It also predicts negative actions, such as marking a post “not interested”, muting, blocking or reporting the author, or scrolling past without stopping.

Stage 4: Scoring and ranking

The system combines these predictions into a single score using weights: in the repository’s words, “Final Score = Σ (weight_i × P(action_i))”. Positive actions add to the score and negative actions subtract. The repository stresses that weights apply to predicted probabilities, not to raw counts of likes or reposts. Adjustments then follow, including reducing repeated posts from the same author, discounting out-of-network posts slightly and giving a boost to new authors.

Stage 5: Mixing the feed

Finally, a reranking step reduces how similar neighbouring posts are, so your feed has variety rather than ten near-identical posts in a row. Ads and other modules are mixed in, and the feed is delivered.

X Algorithm Ranking Signals

Signal type Examples What it means for you
Engagement Likes, replies, reposts, quotes, shares Posts people respond to are shown more
Clicks Opening the post, profile, link, photo or video Curiosity and useful links can help, if people stay
Attention Dwell time, video continuation, time on profile Posts people actually read or watch rank better
Relationship Following the author after seeing a post Posts that win new followers are valued
Negative Not interested, mute, block, report, not dwelling Annoying or irrelevant posts lose reach

Beyond the For You feed, other factors affect visibility. X says Premium subscribers receive prioritised ranking in replies and conversations, and because posts are only candidates for a limited time, early engagement gives the system more evidence while a post is still fresh. Relevance to your audience’s interests, shaped by who engages with you, is central: the algorithm tries to match posts to people with similar interests.

Replies and conversations

Replies are particularly valuable because they signal real interest and create conversation. Posts that start thoughtful discussions tend to keep people on the platform longer. Replying to others in your niche also helps the algorithm understand which communities you belong to.

Media

Images and video can increase attention, as long as they are relevant. Video watch time and continuation are predicted signals, so short, engaging videos that people watch to the end can help.

Links

Many marketers believe X reduces the reach of posts with external links, because links take people off the platform. The published code includes predicted link clicks as a positive signal, but dwell time and other behaviour also matter. A common approach is to make the post valuable on its own, with the link as an optional extra, or to add the link in a reply. Test both for your audience.

What Hurts Your Reach on X

Content people mute, block or report. These are among the strongest negative signals. Aggressive self-promotion, spam, rage bait and off-topic posts can trigger them.

Posts people scroll past. If people consistently do not stop to read your posts, the model learns that your content is less engaging for them.

Breaking rules. Posts that break X’s rules can be limited, labelled or removed, and accounts with repeated violations may see reduced visibility.

Spammy behaviour. Mass tagging, repetitive posts, excessive hashtags, buying followers or engagement, and automated replies can be treated as spam.

Inconsistency. Because posts have a short life in the feed, long gaps mean fewer chances to appear and less data for the algorithm to learn who your audience is.

Poor targeting. Posting about many unrelated topics makes it harder for the system to match you with interested people.

How to Grow With the X Algorithm

1. Know your niche and audience

Decide what topics you will be known for and who you want to reach. Consistent topics help the algorithm connect you with people who engage with similar content, and help your audience know what to expect.

2. Write posts people want to read

Lead with a strong first line, share useful insights, opinions or stories, and make each post stand on its own. Clear, specific posts tend to hold attention better than vague ones.

3. Start conversations

Ask genuine questions, share views that invite discussion and reply to the people who respond. Conversations generate replies, profile visits and follows, all positive signals.

4. Reply to others in your niche

Thoughtful replies to larger accounts and peers in your field put you in front of new audiences and help the system understand where you fit.

5. Use media wisely

Add images, short videos or simple graphics when they make a post clearer or more engaging. Use captions on video for people watching without sound.

6. Use threads for depth

Threads let you explain ideas in more detail while keeping each post readable. A strong opening post encourages people to read on, which increases attention signals.

7. Post consistently

Regular posting keeps you in candidate pools and gives you more data on what works. Check your analytics to see when your audience is most active.

8. Avoid tactics that annoy people

Skip clickbait, misleading hooks, engagement bait such as “like if you agree” and excessive hashtags. One or two relevant hashtags are usually enough, if any.

9. Measure and adjust

Review impressions, engagement rate, profile visits and follower growth for each post. Look for patterns in topics, formats and times, and do more of what works.

X Algorithm Tips for Brands

Brands face a particular challenge on X: people come for conversation and news, not adverts. The accounts that do well tend to act like participants rather than broadcasters. Practical tips include giving the account a clear personality and voice, responding quickly and helpfully to customers, joining relevant conversations and trends where the brand genuinely fits, sharing behind-the-scenes content and expertise from real people at the company, and using humour carefully if it suits the brand. Our guide to meme marketing covers how some brands use humour well.

Paid promotion can amplify strong posts and reach specific audiences, but it works best when the organic content is already engaging. Our X (Twitter) marketing guide covers wider strategy, from profile setup to advertising.

Brand safety is also a consideration. Monitor replies and mentions, set clear rules for what the account will and will not engage with, and review X’s brand safety and ad placement controls if you advertise.

How to Change Your Own X Feed

Users can shape their own For You feed using the same signals the algorithm reads. Engage with posts and accounts you want to see more of. Use “Not interested in this post” on content you do not want. Mute words, phrases and accounts. Unfollow accounts that no longer interest you, and switch to the Following tab for a mostly chronological view. Over time, these actions change what the system predicts you will enjoy.

The X Algorithm and Transparency

X’s decision to publish its recommendation code has been praised for transparency and criticised for leaving out important pieces. Researchers have studied the feed’s effects, including on political content, and journals have published research on how algorithmic feeds shape what people see. For marketers, the practical takeaway is that the system rewards content people genuinely engage with and penalises content they reject, but the exact weights can change at any time. Building a real audience is more reliable than chasing short-term tricks.

How the X Algorithm Compares With Other Platforms

Most major social platforms now use similar ideas: predict what each person will engage with, mix content from followed and unfollowed accounts, and penalise content people reject. The differences are in emphasis. TikTok relies heavily on watch time and shows content from unknown creators to new audiences very quickly. Instagram and Facebook weigh relationships, shares and saves, with different rules for feed, Stories and Reels. LinkedIn focuses on professional relevance and conversation in comments. X is particularly driven by real-time conversation, replies and news, which is why fresh, timely posts and active participation in discussions matter so much there.

For marketers working across platforms, the shared lesson is that algorithms reward content that earns genuine attention from a defined audience. The tactics differ by platform, but the principle is the same: understand your audience, post consistently, encourage real interaction and watch what your analytics tell you. Our guide on how to go viral on TikTok covers that platform in more detail.

Using X Analytics to Learn What Works

X provides post and account analytics that show impressions, engagements, engagement rate, profile visits, link clicks and follower changes. Review them weekly. Sort your recent posts by engagement rate rather than raw impressions, because a smaller post that a high share of viewers engaged with tells you more about what your audience values. Note the topics, formats, opening lines and posting times of your best and worst posts, then run small tests, such as trying a question versus a statement, or a thread versus a single post. Over a few months, these patterns become a practical playbook for your account.

Common Mistakes

  • Chasing hacks. Tricks stop working when weights change. Value lasts.
  • Posting only promotions. Constant selling invites mutes and unfollows.
  • Ignoring replies. Conversation is one of the strongest signals.
  • Overusing hashtags and tags. They can look spammy.
  • Posting inconsistently. Short post lifespans mean gaps cost visibility.
  • Buying followers or engagement. It breaks rules and damages credibility.
  • Not checking analytics. Without data, you cannot improve.

One Rule to Remember

Write for the people, not the algorithm. The algorithm is built to predict what people want, so earning genuine attention is the best way to earn reach.

An Illustrative Example

This example is illustrative and not a real business. A freelance web designer posted on X a few times a month, mostly links to her portfolio, and saw little reach. She narrowed her focus to small business websites, began posting four times a week with practical tips written as standalone posts, and shared one short before-and-after thread each week explaining her design decisions. She also spent fifteen minutes a day replying thoughtfully to small business owners asking website questions. Within a few months her impressions and profile visits rose steadily, several followers became clients and her portfolio link, shared in replies when relevant, received more clicks than before.

The lesson: consistent, useful posts and genuine conversations work with the algorithm rather than against it.

X Marketing as a Career Skill

Understanding how platform algorithms work is a core skill for social media managers and content marketers. If you are building marketing skills in your country or anywhere else, practise by growing an account around a topic you know well for a few months, tracking which posts perform best and writing a short report on what you learned. Being able to explain algorithm signals in plain language is valuable when advising clients and employers. Our guide to the Facebook algorithm shows how a different platform approaches ranking.

Frequently Asked Questions

What is the X algorithm?

The recommendation system that selects and ranks posts in the For You feed on X, based on predicted engagement and other signals.

How does the X algorithm work?

It gathers candidate posts from accounts you follow and recommended accounts, filters them, predicts how likely you are to engage with each, scores them and builds a varied feed.

Is the X algorithm open source?

Much of it is published on GitHub, but X says some parts are withheld and live settings may differ from the code.

What does the X algorithm prioritise?

Posts you are likely to like, reply to, repost, click, read or watch, and that are unlikely to make you mute, block or report.

Do links reduce reach on X?

Many marketers report lower reach for posts with external links. Make posts valuable on their own and test putting links in replies.

Does X Premium help reach?

X says Premium subscribers get prioritised ranking in replies and conversations. Content quality still matters most.

How often should I post on X?

Consistency matters more than volume. Many accounts post daily or several times a week; test what works for your audience.

Do hashtags help on X?

One or two relevant hashtags can help discovery, but too many can look spammy.

How do I reset my X algorithm?

Engage with content you want, mark unwanted posts as not interested, mute words and accounts, and use the Following tab.

How long does a post stay in the For You feed?

The published code filters out posts older than 48 hours from the main candidate pool, so most reach happens soon after posting.

Your Next Step

Want to learn the social media skills to grow audiences on any platform? The Master Diploma in Digital & AI Marketing at Digital Marketing Skill Institute covers AI-powered Social Media Management and Advertising, Lead Generation and Email Automation, Google, and a WordPress and SEO track where you build and rank a real website.

From day one, you work on a real U.S. company’s project through the U.S. Project Internship, so you finish with real results and a verified U.S. work reference letter. You also get unlimited one-on-one coaching. The program carries dual US and UK accreditation, is recognised in more than 100 countries, and runs 100% online over three months.

You can build those skills wherever you live, anywhere in your country. Read student reviews, then apply for the 65% partial scholarship to see if you qualify.

Sources checked November 2026: xai-org/x-algorithm repository on GitHub (For You feed architecture, signals, filters and caveats); X Help Center on the For You timeline and Premium; Metricool, “How the X Algorithm Works”. Top-ranking pages from Viralyft, TweetEraser and SuperX read for coverage only. Algorithm details may change at any time.

Our Master Diploma in Digital & AI Marketing

Where these skills can take you

Work remotely

Earn in dollars, pounds or euros from companies and clients abroad, without leaving home.

Relocate with your family

Build the steady remote income many digital nomad visas ask for.

Work towards a second passport

In some countries, long-term residence can lead to citizenship for you and your family.

Apply for 65% Partial Scholarship 4.8/5 from 3,300+ Google reviews

Visa and citizenship rules vary by country. Individual results vary.

More from the blog