Next.js comparison
Next.js App Router vs Pages Router: which to use and when to migrate
The Next.js App Router vs Pages Router question comes up in almost every Next.js codebase older than a couple of years. Both routers ship in current Next.js, both are supported, and both can live in the same app. So the choice is not about which one still works. It is about which model fits your product and whether moving is worth the cost. I build on Next.js 16 with the App Router and React Server Components today, and I have also moved a large portal off Next.js when it was the wrong fit. Here is how I think about it.
Plan your Next.js moveThe short answer
For a new project, start with the App Router. It is where new Next.js features land, and it lets you keep most of your code on the server.
For an existing Pages Router app that works well, there is no rush. Migrate when you have a reason: a new section, a performance problem the App Router solves, or a feature you need that only exists there. Then move one route at a time.
How each router works
Pages Router
The Pages Router is the original model. Each file in the pages folder is a route. Data loads through special functions that run before the page renders:
getStaticPropsandgetStaticPathsfor pages built ahead of time, with incremental static regeneration to refresh them.getServerSidePropsfor pages rendered on every request.- API routes in
pages/apifor server endpoints. _appand_documentfor shared layout and the HTML shell.
Every page component is rendered on the server and then hydrated in the browser, so all of its JavaScript ships to the client. It is simple, well documented and easy to reason about.
App Router
The App Router lives in the app folder. Folders define routes, and special files define what each route needs: page, layout, loading, error and not-found. Layouts nest and persist between navigations, so shared UI does not re-render on every page change.
The big shift is React Server Components. Components run on the server by default and send no JavaScript to the browser unless you mark them with "use client". Data fetching happens inside async server components, close to where the data is used. You also get streaming with Suspense, Server Actions for form submissions and mutations, Route Handlers for endpoints, and a Metadata API for SEO tags.
Next.js App Router vs Pages Router side by side
| Pages Router | App Router | |
|---|---|---|
| Folder | pages | app |
| Components | Client components, server rendered and hydrated | Server components by default, client where marked |
| Data fetching | getStaticProps, getServerSideProps | Async server components, fetch where you need it |
| Layouts | _app plus manual wrappers | Nested layouts that persist |
| Loading states | Built by hand | loading files and Suspense streaming |
| Mutations | API routes | Server Actions or Route Handlers |
| SEO tags | next/head | Metadata API |
| Navigation hooks | next/router | next/navigation |
A word on caching
Caching is where the App Router has changed most between major versions. Early releases cached aggressively by default, and that surprised a lot of teams. Later versions moved toward caching you opt into, and Next.js 16 adds Cache Components with the use cache directive. My advice: read the caching docs for the exact version you run, and decide per route what can be cached and for how long.
When the Pages Router is still fine
- The app is stable and the team knows it well.
- Pages are simple, mostly static or mostly client-side, so server components would add little.
- A big dependency is not ready for server components yet.
Sticking with the Pages Router in those cases is a reasonable decision, not technical debt.
How I migrate, one route at a time
Both folders can exist in one app, which makes a gradual move possible:
- Create the root layout. Move what lived in
_appand_documentintoapp/layout, with client-side providers wrapped in a small client component. - Pick one low-risk route. Recreate it in
app, then delete the old page. Next.js does not allow the same path in both folders. - Replace data functions. Logic from
getServerSidePropsorgetStaticPropsmoves into the server component, with caching set explicitly. - Switch navigation hooks.
useRouterfromnext/routerbecomesuseRouter,usePathnameanduseSearchParamsfromnext/navigation. - Move metadata. Replace
next/headwith exported metadata. - Leave API routes for last. They keep working, so convert them only when there is a reason.
Measure before and after each step. The goal is a faster, simpler app, not a new folder name.
What I have learned in production
My current work is on Next.js 16 with the App Router and React Server Components. CreditMarket.ae runs on Next.js 15 and HolidayMarket.ae on Next.js 16, and both launched publicly in September 2026. The CreditMarket.ae case study shows the architecture.
I also know the limits. At Creative Chaos I led the migration of Foxtons' UK property portal from Next.js to ReactJS on Vite, which gave a 35% performance improvement. The router is one decision. Whether you need a server framework at all is a bigger one.
Most performance problems are not router problems anyway. Oversized bundles, needless re-renders and slow data calls hurt in both models. My post on optimising React applications covers the basics that still apply.
Getting help
If you are planning a new Next.js build or a migration, see my Next.js development service, or get in touch with your current setup and what is slowing you down.
Frequently asked questions
Is the Pages Router deprecated?
No. The Pages Router is still supported in current Next.js, and existing apps keep working. New features mostly land in the App Router, so that is the better default for new projects.
Can I use the App Router and Pages Router in the same project?
Yes. Both folders can live in one app, which is what makes a gradual migration possible. The one rule is that a path cannot exist in both folders at the same time.
Is the App Router faster than the Pages Router?
It can be, because server components send less JavaScript to the browser and streaming shows content sooner. But a poorly built App Router page can still be slow. Measure your own routes before and after.
How long does a migration from Pages Router to App Router take?
It depends on how many routes, data functions and client-side libraries you have, so I will not quote a number without seeing the code. Moving one route at a time keeps the risk low whatever the size.
Do I need to rewrite my API routes?
No. API routes in pages/api keep working after you adopt the App Router. You can move them to Route Handlers later, when there is a reason to.
Let's talk about your project
Software Architect, AI Native. Google Certified Generative AI Leader with 14+ years of experience.
Plan your Next.js move