Home / Guides / What is __NEXT_DATA__ in Next.js?
Guide · Next.js
What is __NEXT_DATA__ in Next.js?
By SearchWebCode · Updated November 20, 2026 · Next.js · 2 min read
__NEXT_DATA__ is a JSON script used by Next.js Pages Router to deliver page data to the browser. App Router uses a different delivery model, so this element is not a universal Next.js requirement.You may find <script id="__NEXT_DATA__" type="application/json"> near the end of a page. Its text is serialized data for the client. The element is a useful framework clue, but understanding its contents is a separate task from identifying every Next.js website.
Read a small example
This is a simplified illustration, not an exhaustive schema or a captured production page. Fields vary with the application and framework behavior:
<script id="__NEXT_DATA__" type="application/json">
{"props":{"pageProps":{"headline":"Example story"}},
"page":"/news","query":{},"buildId":"demo-build"}
</script>
Here, pageProps contains an example value used by the page. The route, query object and build identifier provide other context. The headline belongs to this example; it is not a special Next.js field.
Inspect it without executing code
In the Console for the relevant frame, read the element's text and parse it as JSON:
const element = document.getElementById('__NEXT_DATA__');
const pageData = element ? JSON.parse(element.textContent) : null;
pageData?.props?.pageProps;
For the example above, the final expression returns an object with the example headline. When the element is absent, pageData is null. Inspect the selected frame and any parse error before assuming the shape is the one your application expects. There is no need to evaluate the text as JavaScript.
The source-search walkthrough explains how original HTML and the current DOM can differ. Keep that distinction when comparing the network response with the element shown in DevTools.
Why a Next.js page may not contain it
Next.js documents this serialized page-data mechanism for Pages Router. App Router uses React Server Components and streaming behavior instead. A search that requires __NEXT_DATA__ can therefore miss Next.js pages built with another router.
Use the full Next.js detection procedure to check asset paths and other framework evidence. Do not classify the page's hosting provider from the framework alone: Next.js can be deployed in different environments.
Keep the payload appropriate
Data sent to the browser can be read by the browser's user, even if the interface does not display every field. When you build the page, include only the values it needs. Treat access control as a server responsibility rather than relying on the page hiding a field.
Large page data also adds bytes and parsing work. Next.js's large-page-data guidance explains the performance problem for Pages Router. Investigate the actual payload and data-fetching choices instead of treating the presence of this element as an error.
Search the marker across stored homepages
__NEXT_DATA__ finds stored references to the marker. Open the matched context: an article about Next.js can quote it without being a Pages Router application. The Next.js source-reference page and source query guide explain how to review the results.
Use the evidence-log approach to distinguish a JSON element, an asset path and a quoted example. Those observations provide different levels of support for the same framework hypothesis.
References
See Next.js's large page data explanation, pageProps documentation and App Router overview.
Source counts checked 2026-10-14. They describe stored homepages, not live installations. How the counts are measured.
← All guides · Browse technologies · Search and export pricing
Frequently asked questions
Is __NEXT_DATA__ JavaScript I should execute?
The application/json element carries JSON data. Read its text and parse valid JSON; do not use eval to inspect it.
Does a missing __NEXT_DATA__ element rule out Next.js?
No. App Router uses a different model. Check other framework markers and the relevant page context.