Headings

Headings are titles or subtitles that you want to display with Markdown. There is a total of 6 different headings.

To create a heading, add hashtag signs # in front of a word or phrase.

The number of number signs you use should correspond to the heading level. For example, to create a heading level three <h3>, use three number signs (e.g., ### My Header).

Syntax

# Heading level 1
## Heading level 2
### Heading level 3
#### Heading level 4
##### Heading level 5
###### Heading level 6

example

Alternate Syntax

Alternatively, on the line below the text:

  • Add any number of == characters for heading level 1
  • Add any number or -- characters for heading level 2.
# Heading level 1
## Heading level 2

Best Practices

Markdown applications don’t agree on how to handle a missing space between the number signs (#) and the heading name.

For compatibility, always put a space between the number signs and the heading name.

✅ Do: # Breaking News

🚫 Don’t: #Breaking News

You should also put blank lines before and after a heading for compatibility and readability.

... text ends here.
# Heading
More text starts here.

Example

# Headings
This page is about headings.
## The cool things about headings
Headings are a great way to format the page.
## Example
Here's an example of headings.
Edit this page on GitHub

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your feedback.

Learn Markdown on Codecademy

Edit this page on GitHub

Contributors