Next.js SEO · Part 2 · HTML fundamentals

How Google reads HTML

What HTML is, how a page's head and body differ, and how Google reads the title, meta description and headings.

What is HTML

HTML stands for HyperText Markup Language. It is the language used to describe the structure and content of a web page.

Imagine a website for a coffee shop. The page needs a heading, a paragraph and a button. Here is the HTML:

HTML
<h1>Welcome to Coffee House</h1>

<p>We serve fresh coffee every day.</p>

<button>Order Coffee</button>

The browser reads that HTML and displays something like this:

Coffee House - Fresh Coffee

Welcome to Coffee House

We serve fresh coffee every day.

Order Coffee

An illustration of how the HTML could appear in a browser.

Notice something important: HTML describes what the content is.

  • <h1> means a main heading.
  • <p> means a paragraph.
  • <button> means a button.

These are called HTML elements. Google also uses HTML to understand what a page contains.

The structure of an HTML document

Most HTML pages have two important sections:

  • <head>: information about the page.
  • <body>: the page's main content.

Here is a complete example:

index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Coffee House - Fresh Coffee</title>

    <meta
      name="description"
      content="Enjoy fresh coffee and pastries at Coffee House."
    />
  </head>

  <body>
    <h1>Welcome to Coffee House</h1>

    <p>We serve fresh coffee every day.</p>
  </body>
</html>

Here is the same structure, visually:

HTML document

<head>

Information about the page

Title
Coffee House - Fresh Coffee
Description
Enjoy fresh coffee and pastries...

<body>

Main content displayed on the page

Heading
Welcome to Coffee House
Paragraph
We serve fresh coffee every day.

The title and the h1

The difference between <title> and <h1> is an important concept for SEO in Next.js.

<title><h1>
LocationInside <head>Inside <body>
PurposeDocument titleMain visible heading
Browser tabUsually shownNot used as the tab title
GoogleMay use for the result titleHelps understand the page content

For example:

HTML
<head>
  <title>Learn JavaScript - Beginner Guide</title>
</head>

<body>
  <h1>JavaScript Tutorial for Beginners</h1>
</body>

Both describe the same topic, but they serve different purposes. They don't have to be identical.

What Googlebot receives

When Googlebot visits a page, it requests the page from the web server. The server sends an HTML response, and Google can analyze that HTML, including the page's metadata and visible content.

Google can also render JavaScript-powered pages to discover content that wasn't present in the initial HTML.