Markdown is a markup language that formats plain text. The formatted text is then converted into another language, such as HTML.
Markdown was developed by John Gruber and Aaron Swartz, and first released in 2004. Today, every major blogging platform supports Markdown, and many platforms offer modified versions of Markdown. For instance, GitHub supports GFM (GitHub Flavored Markdown), which more clearly defines the use of characters and white space, and includes special extensions for including GitHub features.
Markdown quick reference
Section headings
Headings are indicated by prefixing a line with between one and six hash marks (#). The resulting text corresponds to the HTML entities
through.
Including a blank line before a heading is suggested, but not required.
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
In many Markdown renderings, Heading 1 is centered by default.
H1 and H2 can also be indicated by a line, immediately following the heading text, containing only equals signs (=) or dashes (-), respectively.
Heading 1
Heading 2
Emphasis and strikethrough
Emphasis (italicized text) is indicated by surrounding the text in single asterisks (text), or underscores (text).
Strong emphasis (bold text) is indicated by surrounding the text in double asterisks (text), or double underscores (text).
Strikethrough text (text with a horizontal line through the center) is indicated by surrounding the text with two tildes (text).
Emphases can be combined and can overlap.
This entire line will be italicized.
The word hope in this sentence will be bold.
The last word in this sentence is displayed as strikethrough.
In this sentence, some text is bold, some is italicized, and
some is both bold and italicized.
Lists
Ordered lists are indicated by starting a line with a number and a period. Ordered sub-lists are indented by at least one space. The numbers used don’t matter; if they are numbers, the list will be ordered automatically.
Unordered lists are indicated with asterisks (*), pluses (+), or minuses (-), instead of numbers and a period.
Ordered and unordered lists can be mixed, with either being a sub-list of the other.
Paragraphs can be included as list items if they are prefixed with a blank line and preceded by a line break. To skip the line break, add two spaces at the end of the previous line.
- First ordered list item.
- Second ordered list item.
- First ordered sub-list item.
- Second ordered sub-list item.
- Third ordered list item.
- First unordered sub-list item.
- Second unordered sub-list item. A paragraph within the second unordered sub-list item.
- First unordered list item.
- First ordered sub-list item.
- This is also an unordered list item.
- So is this.
Links
Hyperlinks are indicated by surrounding the text of the link in brackets, immediately followed by the URL in parentheses.
Code
Code (e.g., snippet of a computer program), is indicated by surrounding the text in backticks (text
). It’s printed in a monospaced font, with syntax highlighting, if the platform supports it.
Multiple lines of code are indicated by a line containing only three backticks, both before and after the code block. Optionally, you can include the name of the programming language after the first three backticks, to specify the syntax highlighting type.
Here, the code print("Hello, World!")
is monospaced,
with syntax highlighting, if the platform supports it.
The same is true for the following code blocks:
a = "Hello, World!";
console.log(a);
10 PRINT "HELLO, WORLD!"
20 GOTO 10
Images
Images are indicated with an exclamation mark at the beginning of a line, followed by alternate (hover) text in brackets, followed by the image URL.
Formatted text, Markup, Markup language, MD, Typography terms
Related information
- HTML and web design help and support.