---
title: pageExtensions
description: Extend the default page extensions used by Next.js when resolving pages in the Pages Router.
url: "https://nextjs.org/docs/15/app/api-reference/config/next-config-js/pageExtensions"
docs_index: /docs/15/llms.txt
version: 15.5.18
lastUpdated: 2025-06-16
prerequisites:
  - "Configuration: /docs/15/app/api-reference/config"
  - "next.config.js: /docs/15/app/api-reference/config/next-config-js"
---


> For an index of all Next.js documentation, see [/docs/15/llms.txt](/docs/15/llms.txt).
By default, Next.js accepts files with the following extensions: `.tsx`, `.ts`, `.jsx`, `.js`. This can be modified to allow other extensions like markdown (`.md`, `.mdx`).

```js filename="next.config.js"
const withMDX = require('@next/mdx')()

/** @type {import('next').NextConfig} */
const nextConfig = {
  pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md', 'mdx'],
}

module.exports = withMDX(nextConfig)
```
---

For an index of all available documentation, see [/docs/15/llms.txt](/docs/15/llms.txt)