Free auditStart free
GuideError · Browser errors

Text content does not match server-rendered HTML

A React or Next.js hydration mismatch. Find the changing render, bad HTML nesting or CDN rewrite behind it and fix it with useEffect or ssr false.

3 min
read
5
sources
Oct 31, 2026
updated
Scaplet Editorial Team
author
In one line

"Text content does not match server-rendered HTML" is React error 425, a hydration mismatch: the first client render produced different output than the HTML the server sent. Common causes are Date.now() or Math.random() in render, typeof window branches, invalid tag nesting, browser extensions, and CDNs that rewrite HTML. Make the first render deterministic, or move the difference into useEffect.

30-second check

Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode
02How it works

Find the mismatch

Compare origin HTML with CDN HTML
# Replace the origin address with yours
curl -s https://example.com/page > cdn.html
curl -s -H "Host: example.com" https://ORIGIN_IP/page -k > origin.html
diff cdn.html origin.html | head -n 40
  1. 01

    Read the exact message

    In development React and Next.js log which element or text differed. Note whether it names text, an attribute or a tag.

  2. 02

    View source, not the DOM

    Open View Page Source (the server HTML) and compare with the Elements panel (the hydrated DOM). The difference is your mismatch.

  3. 03

    Rule out extensions and the CDN

    Test in a private window with extensions disabled, then fetch the page from origin and through the CDN and diff the bodies.

  4. 04

    Bisect the component

    Comment out time, random and window usage until the error stops, then restore pieces one at a time.

03Fix it on your stack

Fixes, from the Next.js and React docs

1. Render the difference after hydration with useEffect
import { useState, useEffect } from 'react'

export default function App() {
  const [isClient, setIsClient] = useState(false)

  useEffect(() => {
    setIsClient(true)
  }, [])

  return <h1>{isClient ? 'This is never prerendered' : 'Prerendered'}</h1>
}
2. Turn SSR off for one component (Next.js)
import dynamic from 'next/dynamic'

const NoSSR = dynamic(() => import('../components/no-ssr'), { ssr: false })

export default function Page() {
  return (
    <div>
      <NoSSR />
    </div>
  )
}
3. Unavoidable difference such as a timestamp
<time dateTime="2016-10-25" suppressHydrationWarning />
iOS: stop automatic phone and email links
<meta
  name="format-detection"
  content="telephone=no, date=no, email=no, address=no"
/>
Strengths
  • useEffect keeps the server HTML stable and fixes the mismatch at the source
  • ssr: false is quick for widgets that depend on browser APIs
Weaknesses
  • Content set in useEffect or under ssr: false is not in the server HTML, so crawlers that do not run JavaScript will not see it
  • suppressHydrationWarning hides the warning without fixing text that differs
04Explained

What it means for search and crawlers

Google's JavaScript SEO guide says server-side or pre-rendering "is still a great idea because it makes your website faster for users and crawlers, and not all bots can run JavaScript". A mismatch itself is a runtime bug, but the fixes above decide what ships in the server HTML. Keep important copy, links and metadata in the prerendered output, and use the client-only paths for widgets. See JavaScript SEO for what to verify.
Sources · 5

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • nextjs.org
  • react.dev
  • google.com
  1. 01Next.js: Text content does not match server-rendered HTMLnextjs.org · checked 2026-11-01
  2. 02React: hydrateRootreact.dev · checked 2026-11-01
  3. 03React error 425react.dev · checked 2026-11-01
  4. 04React error 418react.dev · checked 2026-11-01
  5. 05Google: Understand JavaScript SEO basicsdevelopers.google.com · checked 2026-11-01
Questions

Asked a lot.

4 questions people ask next, answered from the sources on this page.

01Is a hydration mismatch an error or a warning?

React says to treat mismatches as bugs. In development it warns, and error 418 states that the affected tree will be regenerated on the client.

02Why does it only happen for some users?

Browser extensions that change the HTML before React loads are a documented cause, as are locale-dependent date formatting and iOS data detection.

03Can a CDN cause it?

Yes. The Next.js docs list an incorrectly configured edge or CDN that modifies the HTML response, such as Cloudflare Auto Minify, as a cause.

04Should I just add suppressHydrationWarning?

Only for a single element that must differ, like a timestamp. It works one level deep and React will not patch mismatched text content.

Free · 2 minutes

Tools point. Agencies advise. This one ships.

Run the free audit, then approve the fixes. Every change can be undone.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane