Create Accessible Headings
Headings are HTML tags that are used to divide sections of a page. Headings change the size of the text and indicate the content's structure. They are visual indicators, helping to break up and chunk your content for easy scanning. They are also very important for structure, SEO/AEO, and accessibility.
When writing web text, you always want to use headings to break up your content hierarchically. Search engines and LLMs use headings to construct a better understanding of what your page is about. Screen readers and other assistive technologies use headers to create a table of contents, allowing visually impaired site visitors the same opportunity to skim your text.
The number in each heading indicates its level in the content’s hierarchy. By default, your page titles will be formatted as a Heading 1.
Why use headings?
Improved SEO
Headings serve an important function for search engine optimization (SEO). Think about your headings as keywords that will be crawled by search engines as you create the writing for your website. As headings increase scanning ease for a sighted user, they do the same thing for search engines. Your headings provide keyword-rich context about your site content. That does not mean you should unnaturally use or overuse headings to attempt altering search engine ranking (as this will inevitably fail, search engines are also optimized to recognize these tricks). But bear in mind that your headings, including "keywords" that highlight important topics of your content, will have an impact on the success of your SEO.
Improved accessibility
Headings and subheadings help describe the structure of the page by providing a navigable table of contents for assistive devices. As stated in WebAIM, Web Accessibility in Mind, when use properly, "the user can view a list of all of the headings on the page, or can read or jump by headings, or even navigate directly to top-level headings (<h1>), next-level headings (<h2>), third level headings (<h3>), and so on."
Heading order
Heading types are used as follows and should always be created in order.
- Heading 1: Page title. There can only be a single Heading 1 per page.
- Heading 2: Sub-head. Added in content after a Heading 1. A page can be broken up into multiple sections with Heading 2.
- Heading 3: Grouping or title within a sub-head under a Heading 2.
- Heading 4: Grouping or title within a grouping under a Heading 3.
- Heading 5: Grouping or title title within a grouping under a Heading 4.
To see what each heading level looks like in a text area, visit our Heading Examples page.
Although you may prefer the look of an H4 over an H2, it is more important to always use headings hierarchically. Following the title (h1), the first heading should be a Heading 2 (h2) and if there's more detail needed under that h2, the next heading should be a Heading 3 (h3).
If you don't use headings hierarchically,
- SiteImprove will flag the following issue: Siteimprove issue: Headings are not structured
- Editoria11y will flag the issue: Manual check: was a heading level skipped?
Check your work
Use a tool to help you see the heading structure of your page:
On Stanford Sites, after logging in, Editora11y will annotate page headings. Look for the widget at the bottom of the page.
On any site, the HeadingsMap browser extension will display the heading structure in an outline.
Heading options
The text area is not the only place you need to make decisions about heading order. Content types and Paragraph types have default header settings that reflect the best heading settings for the most common use cases, but more complex layouts may need some adjustment. Many components provide additional control over heading level. Learn more about paragraphs that allow for controls over heading levels:
Best practices for headings
Basic patterns and strategies for headings
- Use sentence case for better readability.
- Ensure all page titles (h1s) on your site are unique.
Keep headings succinct
Headings should not be long. Editoria11y will flag the following issue with this description: Manual check: long heading.
- Keep headings short: skip unneeded words like “How do I...” or “Read how to...”
- But not too short: include keywords to ensure people will understand the context of this page and facilitate searching by headers.
- Keep it simple: avoid jargon and technical terms if possible.
- If you are trying to create a bold statement with your text, rather than open up a new topic, use Splash Font style instead of a heading.
Utilizing an introductory style for presenting longer titles can break down complex information into more digestible parts, ensuring clarity and maintaining reader engagement. Alternatively, using splash text can highlight key elements of the title, drawing attention and making the content more visually appealing and easier to navigate.
Use headings for structure, not for style
When you have a heading such as a Heading 2, it is expected that there is content associated with it. If there is no content, it can be confusing and may lead screen reader users might think the content is hidden.
Given a snippet of text:
- If it provides a title for other content, use a heading.
- If there is no associated text or subheading, don't use a heading. Consider making the text bold or use one of the available text styles.
If you use a heading without following content, SiteImprove will flag the following issue:
Siteimprove issue: Content missing after heading
Always add content after a heading
Headers are meant to be the start of a content area. If you use a heading without following content, you will see errors in both Siteimprove and Editoria11y.
- SiteImprove will flag: Content missing after heading
- Editoria11y will flag: Heading tag without any text
💡 Learn more
Learn more about when to use headings from Stanford's Office of Digital Accessibility.
Your questions answered
Headings always appear on separate lines. This ensures legibility across screen sizes and devices. A heading will NOT wrap around an image or other text.
An H1 should appear only once, and should appear before all other page content. The H1 is always applied to the page title, so it is not possible to place an h1 elsewhere on the page.
If you are looking for additional visual options for your page title, visit our guide to the Page Title Banner.
Related topics
Heading Examples
Examples of heading displays
Text Editing Basics
Learn about the most flexible tool you have with the Text Area Paragraph.
Accessibility Commitment
Stanford Web Services (SWS) is committed to providing an environment that enables site owners to build and manage websites that are accessible to everyone and adhere to Stanford's online accessibility policy
Checking Page Accessibility
The Editora11y Accessibility Checker is available to help you structure your pages well
Make Your Content Machine-Readable with Schema.org Metadata
Search engines, social platforms, and AI agents can use your Schema.org tags to better understand your page