Sub topic 3
Building a heading hierarchy
This chapter assumes you have written work documents such as reports, runbooks, or wiki pages. It also assumes you can read basic Markdown, where # marks a heading. The previous chapters covered how readers skim and how to pick a structure for your content. This chapter covers the skeleton of a document: the heading levels, and the rules that keep them reliable.
What a heading hierarchy is
A heading hierarchy is the nested outline formed by a document's headings. The title sits at the top. Major sections sit under it, and subsections sit under those. A reader who skims uses this outline to decide where to stop and read. If the outline is wrong, the skim fails, however good the paragraphs are.
Each heading level carries a specific meaning:
- Level 1 names the whole document.
- Level 2 names a major part of the document.
- Level 3 names a part of a level 2 section.
- Level 4 and below name smaller parts still. They are rarely needed.
The level is a statement about containment. A level 3 heading says "this section belongs to the level 2 section above me." It does not say "this should look smaller." Choose levels for what they contain, not for how they look.
Rule 1: Use one level 1 heading
A document has one title, so it has one level 1 heading. Everything else nests below it. Two level 1 headings suggest two documents in one file, and they make the outline ambiguous for navigation tools.
Some platforms already add the page title as a level 1 heading. A wiki page title is an example. In that case, start your own content at level 2. Check how your platform renders titles before you decide.
Rule 2: Never skip a level
Go from level 2 to level 3, not from level 2 to level 4. A skipped level leaves a gap in the outline. Readers and tools both wonder what the missing level was meant to be. Moving back up is fine. You can go from a level 4 heading straight to a new level 2 heading, because that closes the open sections.
The following example breaks both rules. It picks levels by appearance.
# Incident report
# Summary
### Timeline
## Impact
#### Customers affectedThis outline has two level 1 headings, a jump from level 1 to level 3, and another jump from level 2 to level 4. The corrected version follows.
# Incident report
## Summary
## Timeline
## Impact
### Customers affectedNow the outline is a clean tree. "Customers affected" belongs to "Impact", and the other sections are siblings.
Rule 3: Make siblings truly parallel
Sibling headings are headings at the same level under the same parent. They should be the same kind of thing. If three of four level 2 sections are phases of a process and the fourth is an opinion, the fourth probably belongs somewhere else.
A quick test is to read only the siblings aloud as a list. They should sound like members of one set.
| Sibling set | Verdict | Why |
|---|---|---|
| Planning, Building, Testing, Releasing | Good | All are phases of one process. |
| Planning, Building, Our budget worries, Releasing | Weak | One heading belongs to a different category. |
| Setup, Configuration, Usage, Troubleshooting | Good | All are stages of using a tool. |
Parallel wording helps too, but the next chapter covers headings as sentences and phrases. Here the concern is that the siblings share a category.
Rule 4: Avoid a lone subsection
A level 3 heading with no sibling under its parent is a warning sign. If "Deployment steps" has exactly one subsection, the subsection adds a level without adding a choice. Either fold it into the parent or add the sibling that the content needs.
This rule has an exception. Sometimes a single subsection is a deliberate placeholder, such as a section that you will extend later. Otherwise, treat a lone child as a flaw to resolve.
Rule 5: Keep the depth shallow
Most documents work with levels 1 to 3. Level 4 is occasionally justified in long reference material. Beyond that, the structure usually means the document is trying to be several documents.
Deep nesting has costs:
- Readers lose track of where they are.
- Each level takes space and adds visual noise.
- Sections at deep levels tend to hold a single paragraph, so the heading outweighs the content.
If you reach level 5, consider splitting the document, or flatten the hierarchy by promoting sections. A short document of three pages rarely needs more than two levels below the title.
Rule 6: Match section size to level
A heading promises a body of content. Sections at the same level should be of roughly comparable weight. If one level 2 section runs to six pages and another to two sentences, the hierarchy misdescribes the document. Look at lopsided sections and ask one of two questions:
- Should the long section be split into several sections at the same level, or into subsections?
- Should the tiny section be merged into a neighbor?
Also watch for text that sits directly under a parent heading before its first subsection. A short introduction there is fine. A long one buries the subsections, so give the introduction its own heading, such as "Overview".
Plan the hierarchy before you write
You can build the outline first and draft the paragraphs afterward. Writing only the headings gives you a document you can test in minutes.
- List the main parts of the document as level 2 candidates.
- Group related material under each one as level 3 candidates.
- Read the headings alone, top to bottom, as if they were the whole document.
- Check whether a reader could find the answer to their likely question.
- Fix gaps, reorder sections, and merge or split before you write any body text.
This is the outline test. If a stranger reads the headings and cannot tell what the document covers or where to look, the paragraphs cannot repair that. Many tools generate this view for you, such as the outline pane in a word processor, the table of contents sidebar in a wiki, or a rendered table of contents in a documentation site.
The same test works in reverse on existing documents. Extract the headings and read them in order. Any place where the outline surprises you is a place where a skimming reader will also be surprised.
Common errors
Several mistakes show up repeatedly in real documents:
- Choosing a level for its look. An author wants smaller text and picks level 4. The result is a skipped level and a false outline. If the default style is wrong, change the style and keep the level.
- Bold text as a heading. A bold line looks like a heading but is not one. Navigation tools cannot see it. The semantic markup chapter returns to this.
- Headings used as emphasis. A heading in the middle of a section, used to call out one sentence, creates a false section.
- Numbering that disagrees with levels. If you number headings manually, "2.1" must sit at level 3 under a level 2 "2". Manual numbers drift when sections move, so use automatic numbering where the tool offers it.
- Copying a document and keeping its levels. When you paste a section from one document into another, its levels may no longer fit. Re-level the pasted headings to match their new parent.
Here is a before and after of a typical wiki page.
# Onboarding guide
## Accounts
### Email
### Chat
### Email signature
#### Request access
## Hardware
### Laptop
## Our cultureThe tree has several problems. "Email signature" sits beside "Email" and "Chat" but is a detail of email. "Request access" is at level 4 under it, which is too deep for one small step. "Hardware" has a lone child, and "Our culture" belongs to a different category than the other level 2 sections. A revision follows.
# Onboarding guide
## Accounts
### Email
### Chat
### Requesting access
## Hardware
### Laptop
### Headset
## Team cultureThe signature detail moved into the email text, the access step became a sibling of the accounts it applies to, and "Hardware" gained a real second child. The category mismatch is also gone if "Team culture" is acceptable as a part of onboarding. Otherwise, move it to its own document.
A short checklist
Before you publish, confirm each point:
- The document has exactly one level 1 heading, unless the platform adds it.
- No level is skipped when you move deeper.
- Siblings are the same kind of thing.
- No section has a single subsection without a reason.
- The outline reads sensibly on its own.
Exercise
A draft has this heading outline: "# Guide", "## Install", "#### Verify the install", "## Configure", "## Configure", then "# Appendix". Name every problem with the hierarchy and write a corrected outline.
Show answer
The problems are a skipped level ("####" directly under "##" with no level 3), a second level 1 heading ("# Appendix") in a document that already has a title, and a duplicate level 2 heading ("## Configure" twice), which makes the outline ambiguous. Also, "Verify the install" is a lone subsection under "Install". A corrected outline is: "# Guide", "## Install", "### Run the installer", "### Verify the install", "## Configure", "## Appendix". Other fixes are valid if there is one level 1 heading, no skipped level, and no lone child. For example, "Verify the install" could be merged into the "Install" section as a final paragraph.
Exercise
You must write a six-page runbook for restoring a database. Describe how you would test the hierarchy before drafting any body text.
Show answer
Write only the headings: one level 1 title and level 2 sections for the main phases, such as before you start, restore steps, verifying the result, and rolling back. Add level 3 headings only where a phase has distinct parts. Read the headings alone from top to bottom. Check that siblings belong to the same category, that no level is skipped, that no section has a single child, and that a stranger could find the restore steps from the outline. Fix the outline first, then write the content under it.