PrettyMD logo

PrettyMD

Markdown editor with live preview and multiple themes

Markdown Guide — Part 1: How to Use Headings

1. Basic Syntax of Headings

Markdown uses # to denote headings.
Different numbers of # symbols represent different heading levels.
It supports six levels in total, from H1 to H6. Generally, it’s not recommended to use more than three levels, as it can make the structure look fragmented. The syntax is as follows:

Level Syntax Example Rendered Result
H1 # Level 1 Heading

Level 1 Heading

H2 ## Level 2 Heading

Level 2 Heading

H3 ### Level 3 Heading

Level 3 Heading

H4 #### Level 4 Heading

Level 4 Heading

H5 ##### Level 5 Heading
Level 5 Heading
H6 ###### Level 6 Heading
Level 6 Heading

2. Hierarchical Structure of Headings

Headings are not just for enlarging text; they also serve as important indicators of document hierarchy.
A clear hierarchy helps readers understand the content quickly and allows for automatic table of contents generation.

Recommended Writing Style

# Project Overview
## Installation Guide
### System Requirements
### Installation Commands
## Usage
### Basic Usage
### Advanced Configuration

Not Recommended Writing Style

# Project Introduction
#### Installation Steps
# How to Use
##### Notes

Although such skipping of heading levels won’t cause rendering errors, it makes the structure confusing and affects readability.

3. Usage Rules for H1

The H1 heading is the main title of the entire document. It usually appears at the beginning, and each document should contain only one H1.

# PrettyMD User Guide

It’s equivalent to the web page title and summarizes the topic of the document. All other sections should start from H2.

4. Four Key Tips for Writing Headings

  • Keep hierarchy clear — follow the logic of “Main Title → Subheading → Subsection,” and avoid skipping levels.

  • Be concise — titles should be short and precise. They act as anchors for readers to quickly scan through the document.

  • Use keywords wisely — in tutorials or blog posts, naturally include relevant keywords in the headings to help search engines understand the topic.

  • Don’t misuse headings for decoration — if you just want to emphasize a word, use bold or italic instead. The purpose of a heading is to define structure, not to style the text.