Markdown cheat sheet
Here is the Markdown formatting for headings, bold and italics, lists, links, images, code, tables, block quotes and the horizontal rule. Each row shows what you type on the left and what it does on the right.
To see any line render, paste it into the Markdown editor. For bigger tables, the table generator writes the syntax for you.
Headings
Put a space after the # signs. One # sign makes the largest heading, and six # signs make the smallest.
# Heading 1Page title (level 1)## Heading 2Section heading### Heading 3Sub-section#### Heading 4Levels 4 to 6 work the same wayBold, italics and other formatting
Bold in Markdown is two asterisks or two underscores on each side of the words. One asterisk or one underscore on each side gives italics.
**bold text**Bold__bold text__Bold (underscore form)*italic text*Italics_italic text_Italics (underscore form)***bold and italic***Bold and italic together~~struck out~~Strikethrough (GFM)Paragraphs and line breaks
(a blank line)Starts a new paragraphtwo spaces at the end of a lineLine break inside a paragraph\ at the end of a lineLine break you can see in the sourceLists
Indent a line under a list item to nest a list inside it.
- itemBulleted list (* and + also work)1. itemNumbered list - sub-itemNested item, indented under its parent- [ ] taskTask list, not done (GFM)- [x] taskTask list, done (GFM)Links
A Markdown link is the link text in square brackets, then the address in round brackets with no space between them.
[MarkPrep](https://markprep.online)Link with text[MarkPrep](https://markprep.online "Home")Link with a hover title<https://markprep.online>The address itself as a linkhttps://markprep.onlineBare address becomes a link (GFM)[text][1] then [1]: https://markprep.onlineReference link, address kept at the end of the documentImages
Image, with alt text for screen readersImage with a hover titleCode
`inline code`Code inside a sentence```jsOpens a code block; the word after the backticks names the language```Closes the code block four spaces of indentIndented code block (older style)Tables (GFM)
Colons in the second row set the alignment of each column.
| Name | Score |Header row| --- | --- |Divider row (required)| Ana | 9 |Data row| :--- | :---: | ---: |Left, centre and right alignmentBlock quotes
> quoted textBlock quote>> quote inside a quoteNested block quoteHorizontal rule (horizontal line)
A Markdown horizontal line, also called a horizontal rule, is a line with three or more hyphens, asterisks or underscores and nothing else. Leave a blank line above ---. Placed directly under a line of text, --- turns that text into a heading.
---Horizontal line***Horizontal line___Horizontal line- - -Spaces between the characters are allowedEscaping
A backslash before a punctuation character shows the character instead of using it as formatting.
\*not italic\*Shows the asterisks\# not a headingShows the # sign\|A pipe character inside a table cellNew to Markdown? Read what an MD file is and how to open one. Writing a prompt? See Markdown for AI prompts.
Frequently asked questions
How do I make a horizontal line in Markdown?+
Type three hyphens (---), three asterisks (***) or three underscores (___) on a line of their own, with a blank line above. Each one makes the same horizontal rule, which becomes an <hr> element in HTML.
Why did my --- turn the line above it into a heading?+
A line of hyphens directly under a line of text makes that text a level 2 heading. Add a blank line between the text and the hyphens, or use *** instead.
How do I make text bold in Markdown?+
Put two asterisks on each side of the words, like **this**. Two underscores (__this__) give the same result. In HTML, bold text becomes a <strong> element.
How do I add a link in Markdown?+
Write the link text in square brackets and the address in round brackets straight after it, for example [MarkPrep](https://markprep.online). The address can also be a path on the same site, such as /about.
What does GFM mean?+
GFM is GitHub-flavoured Markdown. It adds tables, task lists, strikethrough and automatic links to the original syntax. Rows marked GFM render in the MarkPrep editor and viewer but may show as plain text in apps that use only the original syntax.