How do you let users browse a thousand items without making them click a thousand times? Pagination is the answer — but which strategy is right for your use case? This guide covers the six major pagination approaches, their tradeoffs, and the surprising truth about SEO.
FrontendX EngineeringSystem Design Series
What Are Pagination Strategies?
Every application with more than a handful of items faces the same problem: you cannot send everything at once. Pagination is the art of splitting a large dataset into manageable chunks that the user can navigate through.
But "just add page numbers" is rarely the full answer. The strategy you choose affects your database query patterns, your API design, your UI performance, and even your search engine rankings. The wrong choice can tank your UX or collapse your database under load.
This guide covers six strategies, from the familiar numbered pages to the exotic world of virtual scrolling. We will look at how each one works under the hood, when it shines, and the tradeoffs you accept when you choose it.
1 · Offset-Based Pagination
Offset pagination is the simplest and most familiar approach. The client specifies a page number and a size (items per page). The server translates that into LIMIT size OFFSET page * sizeand returns the matching slice.
Property
Details
API format
GET /items?page=3&size=20
Server query
SELECT * FROM items LIMIT 20 OFFSET 40
Total count
Requires a separate COUNT(*) query
Stability
Items shift when new rows are inserted — duplicates or missed items
The phantom row problem
Offset pagination has a well-known flaw: if a new item is inserted at the top of the list while a user is browsing, every subsequent page shifts by one. The user sees the same item on two pages, or misses an item entirely. This "phantom row" problem makes offset unsuitable for real-time feeds.
The large offset problem
Database servers hate large offsets. LIMIT 20 OFFSET 10000still scans 10,020 rows, discarding the first 10,000. This makes deep pagination expensive. For social feeds or search results users rarely go past page 10, but for admin panels or data exports this can cripple performance.
Warning
Offset pagination is fine for small, stable datasets where deep pagination is rare. Do not use it for real-time feeds, large datasets (100k+), or when users regularly browse past page 10.
2 · Cursor-Based Pagination
Cursor pagination (also called keyset or seek pagination) solves the phantom row problem. Instead of counting rows to skip, the server returns a cursor — typically an opaque token or the ID of the last item — that the client sends back on the next request. The server queries WHERE id > cursor, guaranteeing perfect stability.
Key Insight
Cursor pagination is stable. New items inserted at the top do not shift the page boundary. Each request picks up exactly where the last one left off. This is why Twitter, Reddit, and every major social platform use cursor-based pagination.
Two flavors
Opaque cursors are encoded strings (e.g., base64 of id:timestamp). The client treats them as black boxes. This gives the server freedom to change the encoding or sorting without breaking clients. GraphQL's Relay specification uses opaque cursors.
Transparent cursors expose the sort key directly. The client sends ?after_id=42. Simpler to implement but couples clients to the data model. Good for internal APIs or stable, single-key sorts.
Tradeoffs
No random access: You cannot jump to page 5. There is no "page number." The user must scroll or paginate linearly.
Requires a unique, sortable column (usually the primary key or a timestamp). Composite cursors work but add complexity.
No total count by default. You can return ahas_more boolean, but computing the exact total requires an expensive count.
Pattern
API
Cursor encoding
REST simple
GET /items?after_id=42
Transparent (id)
REST encoded
GET /items?cursor=abc123
Opaque (base64)
GraphQL (Relay)
{ items(first: 20, after: "abc") }
Opaque (Relay spec)
Note
Opaque cursors are the safer long-term choice. They allow you to change the sort key, encoding format, or even the underlying database without breaking existing clients. The GraphQL Relay specification mandates opaque cursors for this exact reason.
3 · Numbered Pages & SEO
Numbered pages (offset-based with page navigation) are the most familiar UX pattern. Users see "Page 1, 2, 3…" and can jump to any page directly. From a user experience perspective, this is the most predictable and controllable pattern.
SEO implications
Numbered pages are significantly better for SEOthan infinite scroll or cursor-based pagination. Search engine crawlers can visit each page as a unique URL:
/products?page=1 — crawler visits and indexes items 1-20
/products?page=2 — crawler visits and indexes items 21-40
Each page has its own URL, title, and indexed content. This is what Google wants.
Warning
Infinite scroll is a black hole for search engines. Googlebot will not scroll your page. If you use infinite scroll, you need a separate sitemap or numbered-page fallback for SEO to work.
Best practices for SEO-friendly pagination
Use rel="prev" and rel="next" link tags to tell Google about the page sequence.
Include a canonical URL for each page to avoid duplicate content issues.
For e-commerce, consider a "View All" option withrel="canonical" pointing to the first page.
Use <title> variations: "Products — Page 2" helps both users and crawlers.
Tip
If SEO matters for your paginated content (e-commerce, blogs, directories), always use numbered pages. You can combine them with infinite scroll on the frontend — show infinite scroll but update the URL as the user scrolls, so the crawler sees numbered pages.
4 · Infinite Scroll
Infinite scroll loads more content automatically as the user approaches the bottom of the page. It is the dominant pattern for social media feeds (Twitter, Instagram, TikTok) where content discovery is the primary goal.
When to use
Content discovery: Social feeds, photo galleries, video recommendations.
Mobile-first: Thumb scrolling is more natural than tapping page numbers on a phone.
Engagement metrics: Infinite scroll increases time-on-page and pages-per-session.
Implementation details
The core mechanism is the Intersection Observer API. Place a sentinel element at the bottom of the list. When the sentinel enters the viewport, fire the next page request. Append the results, then reposition the sentinel.
Tradeoffs
No footer: Users can never reach the bottom of the page. Footer links, terms of service, and navigation become inaccessible.
Memory bloat: Every loaded item stays in the DOM. After 50 pages, the browser is holding thousands of DOM nodes. Virtual scrolling can help here.
SEO nightmare: As discussed, crawlers cannot navigate infinite scroll. You need a fallback.
Scroll position loss: Navigating away and coming back loses the user's position. Browser back button becomes unpredictable.
Key Insight
Infinite scroll is addictive by design. It removes friction from browsing but also removes control. For goal-oriented users (shopping, research), infinite scroll reduces satisfaction. For exploration (browsing, social), it maximizes engagement. Know your user's intent.
5 · Load More Button
The "Load More" button is the compromise between numbered pages and infinite scroll. The user clicks a button to load the next batch. It gives the user control — they choose when to load more — while keeping the continuous, appending feel of infinite scroll.
Why it is often the best choice
User control: The user decides when to load more. No surprise scroll-triggered loading when they are trying to reach the footer.
Footer accessible: The footer stays visible until the user clicks. Terms of service, social links, and sitemaps remain reachable.
Better performance: Load More only fires on click, not on every scroll event. Fewer network requests, less DOM growth.
SEO-friendly hybrid: Each "load more" can update the URL via history.pushState, creating de facto numbered pages for crawlers.
Implementation pattern
Load More works well with cursor-based pagination on the backend. The button triggers the next cursor request, appends the items to the existing list, and replaces the button with a new one (or hides it if has_more is false). The URL bar updates with each load to enable bookmarking and back-button behavior.
Note
Load More is the safest default for most applications. It balances UX, performance, and SEO better than any other single pattern. Start with Load More; switch to infinite scroll or numbered pages only when your specific use case demands it.
6 · Virtual Scrolling
Virtual scrolling is not a pagination strategy per se — it is a rendering optimization. Instead of rendering all items in the list (which would kill performance for 10k+ items), you render only the items currently visible in the viewport, plus a small overscan buffer. As the user scrolls, you recycle DOM nodes.
Figure 4 — Virtual scrolling architecture. Only a small window of DOM nodes exists regardless of list size.
How it works
The container has a fixed height and overflow-y: auto.
An inner spacer div is sized to the total list height (item count × item height). This creates the scrollbar.
As the user scrolls, calculate which items are visible. Render only those, absolutely positioned at the correct offset.
An overscan buffer (usually 5-10 items above and below) prevents blank areas during fast scrolling.
When to use virtual scrolling
Large lists (1,000+ items): Data grids, chat logs, log viewers, terminal output.
Fixed-height items: Much simpler to implement. Variable heights need a size cache and are more complex.
Combined with infinite scroll: Load more data from the server, virtualize the rendering. Best of both worlds.
Libraries
Library
Size
Features
react-window
~5 KB
Fixed + variable, grid, memoized
TanStack Virtual
~3 KB
Framework-agnostic, dynamic size, sticky
react-virtuoso
~8 KB
Auto-size, sticky headers, grouping, chat
Warning
Virtual scrolling gives you the illusion of browsing a giant list, but the data must already be in memory. It does not replace API pagination — it replaces DOM rendering. You still need to fetch data in chunks from the server.
7 · Head-to-Head Comparison
Here is how the six approaches stack up across the dimensions that matter most in production:
Figure 2 — Strategy comparison across key dimensions. No single winner; pick by context.
Dimension
Offset
Cursor
Numbered
Infinite
Load More
Virtual
Stability
Low
High
Low
Low
Low
High
Real-time safe
❌
✅
❌
❌
❌
✅
SEO friendly
✅
❌
✅⭐
❌
With fallback
❌
DB perf (large offset)
Bad
Good
Bad
Good
Good
N/A
Random access
✅
❌
✅
❌
❌
❌
Implementation complexity
Low
Medium
Low
Medium
Low
High
User control
High
Medium
High
Low
High
Medium
8 · Decision Flow
Choosing the right pagination strategy is about matching your constraints to the tradeoffs. Here is a mental model that works for most scenarios:
Does SEO matter?▾
E-commerce, blogs, directories — Google needs URLs for each page.
Numbered pages (offset)
Unique URLs per page. Link rel prev/next. Best for crawlability.
Is the data real-time / frequently inserted?▾
Social feeds, comments, live dashboards.
Cursor-based pagination
Stable across insertions. No phantom rows. Use opaque cursors.
Is the dataset 1,000+ items?▾
Admin panels, data grids, log viewers.
Virtual scrolling
Only render visible items. Pair with cursor API for server data.
What is the user's intent?▾
Exploration vs goal-oriented browsing.
Infinite scroll — exploration mode
Social feeds, photo galleries, recommendations. Maximizes engagement.
Load More — controlled mode
Search results, product listings, any task with a goal. Safer default.
Figure 3 — Decision flowchart. Start with your primary constraint (SEO, real-time, scale), then choose the UX pattern.
Tip
The most effective pagination setups combine multiple strategies. A product listing might use numbered pages for SEO, cursor-based API for backend efficiency, and a "Load More" button for the frontend UX — all at the same time. They are not mutually exclusive.
9 · Key Takeaways
Strategy
Use When
Avoid When
Offset
Small datasets, simple APIs, admin tools
Real-time feeds, deep pagination past page 10
Cursor
Real-time feeds, social media, large datasets
When users need random page access or SEO matters
Numbered pages
SEO-critical content, e-commerce, blogs
Real-time data, mobile-first discovery flows
Infinite scroll
Social feeds, photo galleries, mobile content discovery
Goal-oriented tasks, pages with footer links, SEO
Load More
Search results, product listings, most web apps
Infinite content streams, mobile-first discovery
Virtual scroll
Large lists (1k+), data grids, chat logs
Short lists, SEO-needed content, simple apps
Key Insight
There is no single "best" pagination strategy. The right choice depends on your data characteristics (stable vs real-time), user intent (exploration vs goal-oriented), and SEO requirements. The most sophisticated systems combine multiple strategies — cursor for the API, numbered URLs for SEO, and a frontend UX that bridges the two.