Introduction

Next.js offers two routing systems: Pages Router and App Router. While Pages Router has been the default for years, App Router was introduced in Next.js 13 to provide more advanced features like nested layouts, React Server Components, and improved data fetching. This document compares the two systems to help you decide which one to use for your project.


1. Pages Router

Overview

The Pages Router is the traditional file-based routing system in Next.js. Every file in the pages directory automatically becomes a route. For example:

Pros

Cons

Use Cases