App Router vs Pages Router
Next.js currently ships with two different routing systems. The Pages Router, based on a pages/ folder, was the original and only routing system for years, and is still fully supported. The App Router, based on an app/ folder, was introduced as stable in Next.js 13 and has been the actively developed, recommended default ever since, refined through Next.js 14 and 15.
Comparison
Aspect | Pages Router ( | App Router ( |
|---|---|---|
Folder convention | Every file in | A route needs a folder containing a |
Component model | Every component is a Client Component; everything ships to and hydrates in the browser. | Components are Server Components by default; opt into Client Components with |
Data fetching |
| Plain |
Layouts | Manually composed via a single | Nested |
What each folder convention looks like
Pages Router — pages/about.tsx
export default function About() {
return <h1>About Us</h1>
}
export async function getServerSideProps() {
const data = await fetch('https://api.example.com/about').then((r) => r.json())
return { props: { data } }
}App Router — app/about/page.tsx
export default async function About() {
const data = await fetch('https://api.example.com/about').then((r) => r.json())
return <h1>{data.title}</h1>
}