How to Create the Perfect H1 Tag for SEO

How to Create the Perfect H1 Tag for SEO? How to analyze and optimize them? In this comprehensive guide we will see how to use Hn tags to improve the SEO of a website.

Headings are one of the very few on-page elements you control completely: no algorithm update takes them away from you, and no competitor can touch them. Get the hierarchy right once and every page you publish afterwards inherits a cleaner structure. Here is what this guide covers:

  • What H1 to H6 actually do, in HTML and in search
  • How to pick the words that go inside them
  • How the H1 relates to the title tag shown in Google
  • A repeatable audit you can run on any page in about ten minutes
  • The theme and page-builder mistakes that quietly break heading structure

What are the H1,… H6 tags?

There are 6 tags (HTML tags) of type Hn: H1, H2, H3, H4, H5 and H6. They are used to add titles to your texts and to prioritize your content. For simplicity and to talk about all these tags in general, replace the number after H with an “n”.

The number after H determines the level of the title. An H3 tag will be a subtitle of an H2 tag which in turn will be the subtitle of an H1 tag.

Hn tags are also called title tags but they should NOT be confused with the title tag (meta title).

These are semantic elements, not styling elements. A browser renders them large and bold by default, but that is a side effect. Their real job is to describe the structure of the document, which is exactly what a screen reader uses to let a blind visitor jump from section to section, and what a search engine uses to work out which passage of your page answers which question. The W3C accessibility tutorial on headings is the reference worth bookmarking here.

LevelWhat it should carryHow often per page
H1The single main topic of the pageOnce
H2The main sections of that topicUsually 3 to 8
H3Sub-points inside an H2 sectionAs many as the section needs
H4 to H6Deep nesting: specifications, sub-cases, long FAQ treesRare on ordinary pages

If you find yourself reaching for H5 or H6 on a normal blog post, the page is usually trying to do too many jobs at once and should be split into two pages.

What does an H1 tag look like in HTML?

Here’s what an H1 tag looks like in your site’s HTML code:

H1 tag in HTML

In the screenshot above, the H1 label is the part highlighted in blue.

Written out, the difference between a heading and a piece of text that merely looks like one is this:

<!-- Correct: one descriptive H1 that names the topic -->
<h1>How to Choose a Gaming Mouse</h1>

<!-- Wrong: a heading used only to make text big -->
<h1 class="promo-banner">Sale!</h1>

<!-- Right way to get the same look without the semantics -->
<p class="promo-banner">Sale!</p>

The second example is the single most common heading mistake on commercial sites. It costs nothing to fix and it removes a false signal about what the page is for.

Why are Hn tags important in SEO?

Hn tags are very useful for natural references to the pages of your site. They are undoubtedly among the most important criteria after the TITLE tag.

When calculating the relevance of a page, Google gives more weight to the words in your titles. 

It seems quite logical: when you read a text, the titles will help you understand the content a page. 

It is very possible that at the beginning you only scan the article, they will become even more important. 

This is very well understood by Google and for this reason, the words that are in the titles and subtitles of your pages are treated as important.

The hierarchy of titles is also important. An H1 tag is more important than an H2 tag. 

The words in the first tag will have more weight in calculating the relevance of your page than the words you add in the second.

Google’s own SEO starter guide puts it in plainer terms: use headings to signal the structure of your content, and write them as if you were writing an outline for a reader. That advice has not changed in years, which tells you something about how stable this part of on-page SEO is compared with everything else.

There is a second reason headings matter more now than they did a few years ago. Search results, featured snippets and AI-generated answer boxes are increasingly built from passages rather than whole documents. A section that opens with a clear, self-contained H2 such as “How much does a gaming mouse cost?” is far easier for a machine to lift and attribute than the same paragraph buried in an unbroken wall of text. Good headings are, in effect, quotation handles.

What words should you use in Hn tags?

As you can see, you need to choose carefully the words that you will add in the Hn tags. This means that you must first perform a keyword analysis.

Ideally, the H1 tag should contain the main phrase for which you have decided to position the page in search engines. 

Indeed, since this tag is the most important title, it needs to contain your main keyword so that it has a maximum weight in calculating the relevance of your page. 

The following tags (H2, H3, etc.) should contain the secondary phrases that you identified during your keyword analysis.

Before you commit to an H1, run it through these five checks:

  • Intent match. Look at what currently ranks for your target phrase. If the results are all comparison pages and your H1 promises a definition, the heading is wrong before you write a word of body copy.
  • Main term early. Put the keyword towards the front of the heading rather than trailing it after a clause of throat-clearing.
  • Reads aloud cleanly. If you cannot say it to a colleague without wincing, it is keyword-stuffed. Say it out loud.
  • Distinct from the H2s. The H1 states the topic; the H2s state the parts. If an H2 repeats the H1 almost word for word, one of them is redundant.
  • No brand padding. The brand belongs in the title tag, not in every H1 on the site.

If you write an article whose main topic is “how to choose a mouse”, the h1 tag should contain “How to choose a mouse?”.

You can then add h2 tags from sub-sub-topics or keywords related to the main topic such as: “Find a gaming mouse for your hand”, “What is the right price for a gaming mouse”, “How to check if my gaming mouse is of quality”, Etc..

Laid out as a working outline, that same article looks like this. Notice that every heading owns exactly one term, and that no two headings compete for the same one:

LevelHeading textTerm it owns
H1How to Choose a Gaming Mousehow to choose a gaming mouse
H2Wired or wireless: which one should you buy?wireless gaming mouse
H2Sensor, DPI and polling rate explainedgaming mouse DPI
H3Does higher DPI actually help you aim?high DPI aiming
H2Finding the right shape for your gripclaw grip mouse
H2Entry level or premium: what changesbudget gaming mouse
H2How to test a mouse before you keep itgaming mouse test

Build this table before you write. It doubles as your brief, and it stops the article drifting off topic halfway through.

H1 versus the title tag: should they be identical?

They serve two different audiences. The title tag is what competes for the click in the search results; the H1 is what greets the visitor once the click has already happened. Making them byte-for-byte identical is not an error, but it wastes the qualifier you could have used to win the click.

ElementExampleJob
Title tagHow to Choose a Gaming Mouse: Buyer’s ChecklistWin the click in the results page
H1How to Choose a Gaming MouseConfirm the visitor landed in the right place
Meta descriptionGrip, sensor, weight and price, with a short test you can run in the shop.Set expectations, support the click

Keep both anchored to the same topic. If the two drift apart, the visitor feels the mismatch immediately and bounces. It is also worth knowing that Google rewrites title links in the results when it judges yours to be a poor fit, and one of the sources it may draw on is the page’s own H1, which is another good reason to keep the H1 descriptive rather than clever. Google documents this behaviour in its guidance on title links.

How should Hn labels be organized?

As we saw earlier in this article, the number behind H defines the importance of the title. 

This means that the order in which you add title tags to your page is also important. 

For example, you cannot start an article directly with an H2 tag without adding an H1 tag first. Below is a view that shows what a correct hierarchy of Hn tags should look like.

Hn Tag hierarchy

If you don’t organize your Hn tags correctly, Google will have a hard time understanding the content of the page. A misunderstanding will lead to the loss of the relevance of the key terms for your page with a negative effect on its position in search engines.

Two rules cover almost every real case. First, never skip a level on the way down: an H2 may be followed by an H3, never straight by an H4. Second, you may jump back up as far as you like, so an H3 can be followed by the next H2 without anything in between. Think of it as an indented table of contents, because that is literally what assistive technology turns it into.

Hn Tags analysis 

Fortunately, there are many tools that will allow you to check if Hn tags are well organized on your pages. I recommend that you use the free Alyze tool to check the contents of each Hn tag, as well as their hierarchy.

For a single page you do not even need a tool. Open the page, press F12 to open your browser’s developer tools, switch to the Console tab and paste this one-liner:

document.querySelectorAll('h1,h2,h3,h4,h5,h6')
  .forEach(h => console.log(h.tagName, '|', h.innerText.trim()));

You get the page’s real outline as the browser sees it, including headings injected by the theme that never appear in your editor. Here is the audit sequence I run for a whole site:

  1. Crawl the site with any SEO crawler and export the H1 column together with the URL and the title tag.
  2. Sort and flag three problems: pages with no H1, pages with more than one H1, and identical H1s repeated across different URLs.
  3. Open Google Search Console, go to the performance report and filter by page. Compare the query that actually brings each page its impressions with the wording of that page’s H1.
  4. Where the two do not overlap at all, rewrite the H1 to speak the language of the query, as long as the page genuinely answers it.
  5. Re-crawl after two or three weeks and check the same pages again in Search Console.

One note on measurement while you are in there. Search Console is the tool for query data; your analytics platform is the tool for what people do after the click. Judge a heading rewrite on impressions and average position for the queries that page was already close on, and give it a few weeks before you read anything into the numbers.

How many H1 tags are needed per page?

No consensus has been reached on this point. 

Some people think it’s not a problem to have a few H1 tags on one page, while others, like me, prefer to have only one H1 tag on the page.

Since, in SEO, it is better for a page to deal with only one main topic, I think it is more logical that there is only one H1 per page. 

Indeed, the H1 tag is the most important title and must contain the main topic of the page, so I find it strange that there may be more than one main topic for the same page.

 Moreover, most CMS, such as WordPress or Prestashop, are usually configured to have only one h1 per page. 

For example, when you create a new post in WordPress, the title of the article will be directly in H1 because it is the main topic of the page. I advise you to simplify your life and use only one H1 tag per page.

For completeness: Google has said publicly, more than once, that several H1s on a page will not break your rankings, and that remains true. The reason I still recommend one is not fear of a penalty, it is discipline. There was also an old idea that HTML5 sectioning elements let you restart the heading scale inside every <section>, so multiple H1s would be re-levelled automatically. No browser ever implemented that outline algorithm, and the spec guidance moved away from it, so explicit levels are what you should use.

How long can Hn labels be?

There is no set length for Hn tags. However, we must not forget that they will be used as a title in your text. Therefore, it is preferable to be relatively concise if you do not want to completely interrupt the design of your site. 

By the way, the more words you add to the Hn tags, the more you will dilute the impact of each word to calculate Google relevance. 

Therefore, it is preferable to use relatively short titles. But remember that your headlines are present primarily to your visitors and the pages should be read with pleasure.

These are the editorial targets I work to. They are house rules for readability, not thresholds imposed by any search engine:

LevelPractical targetReason
H1Roughly 25 to 70 charactersStays on two lines or fewer on a phone screen
H2Roughly 25 to 60 charactersWorks as a scannable table-of-contents entry
H3Under 60 charactersKeeps sub-sections visually lighter than sections

One design caveat worth knowing: on most article layouts the H1 is the largest element above the fold, which means it is very often the element the browser counts as your Largest Contentful Paint. If that heading waits on a custom web font that loads late, your LCP measurement suffers for reasons that have nothing to do with the words in it. Serving the heading font with a sensible fallback is the cheap fix.

A common problem with Hn!

If you analyze the Hn using the Alyze tool, it is very possible to find title tags that you did not add.

This is a common problem encountered on WordPress, Prestashop or any other CMS. 

The blame comes from designers and theme creators, who tend to use Hn tags to apply a certain design. 

That’s why you may have on your WordPress theme, for example, H3 on the word “frase” or H4 on the word “car” in your Prestashop store.

If this is the case with your site, the best solution is to correct the theme and fix these mistakes. They are a problem for optimizing the SEO of your site.

In practice, the offenders are nearly always the same handful of places. Work through them in this order:

  1. Find the element. Right-click the stray heading, choose Inspect, and note where it sits: header, sidebar, footer, or a widget area.
  2. Widget titles. Sidebar and footer widget titles are frequently rendered as H2 or H3. Most themes expose the level in the widget or block settings; change it there rather than in code.
  3. The site logo or tagline. Some older themes wrap the logo in an H1 on every page. On the homepage that is arguably defensible; on an article it means the page has two H1s, one of which is your brand name.
  4. Page-builder heading widgets. These usually default to H2 whatever size you pick. Level and font size are separate settings: set the level for meaning, set the size for design.
  5. Block themes. Open the Site Editor, edit the template or template part directly, and change the level on the heading block. Nothing else needs touching.
  6. Classic themes. Edit the template file in a child theme. Never modify the parent theme, or the next update will silently undo your work.

The ten-minute H1 checklist

Run this before you publish anything. It is short enough that you will actually do it.

  • The page has exactly one H1, and it is the first heading in the main content.
  • The H1 contains the primary phrase, near the front, in natural word order.
  • The H1 and the title tag agree on the topic but are not carbon copies.
  • No heading level is skipped on the way down.
  • No heading exists purely to make text large; those are paragraphs with a CSS class.
  • Each H2 could stand alone as a question or a section label if read out of context.
  • The console one-liner above returns the outline you expect, with no surprises from the theme.

H1 tag FAQ

Can an image be used as an H1?

Technically yes: an image placed inside the H1 element, with descriptive alt text, will be read as the heading. I still prefer real text. Text is selectable, translatable, restyleable and cannot be broken by a failed image request, and alt text is easy to lose during a redesign.

Do heading tags affect Core Web Vitals?

Not directly, but there is an indirect link worth remembering. The H1 is frequently the Largest Contentful Paint element, so heading fonts and above-the-fold layout affect that score. The other two metrics are Cumulative Layout Shift and Interaction to Next Paint, and note that INP replaced First Input Delay as an official Core Web Vital back in March 2024, so any checklist you find that still measures FID is out of date. The web.dev explainer on INP covers what changed.

Should the brand name go in the H1?

Generally no. Space in an H1 is expensive and the brand adds nothing to the topic. The exception is the homepage of a brand people search for by name, where an H1 built around the brand is exactly right.

What about an H1 hidden with CSS?

Avoid it. Hiding a keyword-loaded H1 behind display:none is an old trick that adds risk without adding value. If a heading is worth having, it is worth showing to the reader.

How often should I change my H1s?

Only when the page’s purpose or its actual search demand has moved. Rewriting headings every quarter to chase small ranking movements makes it impossible to attribute any change to anything. Change one thing, wait for a few weeks of Search Console data, then judge.

Do headings help with AI-generated answers?

They help in the same way they help human scanners. Systems that summarise pages work with passages, and a well-scoped section under a clear heading is a cleaner passage to quote than the middle of a long undifferentiated block of prose.

Let’s wrap this up

That’s it, now you know the role of Hn tags and how to optimize them to improve your SEO. 

If your site is already online, I suggest you initially check the Hn tag architecture with Alyze and, if you have a problem, try and fix it.

Then do a keyword analysis and finally optimize your Hn tags accordingly. 

None of this is glamorous work, and none of it will show up as a dramatic overnight jump. What it does is remove ambiguity: about what each page is for, about which page should rank for which phrase, and about how a visitor with a screen reader navigates your site. Do it once across the templates, keep the checklist next to you when you publish, and it stays fixed. If you would rather have the whole heading structure audited alongside the rest of your on-page work, that is part of what our SEO services cover.

Free backlink audit

Want links like the ones in this playbook?

Get a free, same-day audit of your backlink profile — 3 quick wins and exact pricing, no obligations.

Get my free audit →

Leave a Comment

EN|DE|RO