Getting Started
Headers & Paragraphs
Use # for headers (1-6 levels). Alternative syntax uses === for H1 and --- for H2. Paragraphs need a blank line between them. Markdown is designed to be readable as plain text.
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
Alternative Heading 1
=====================
Alternative Heading 2
---------------------
This is a paragraph. Just write
plain text. Leave a blank line
between paragraphs.Line Breaks
Two trailing spaces or a backslash at the end of a line create a hard line break (<br>). Without them, a single newline is a soft wrap that joins into one paragraph. Always leave a blank line to separate paragraphs.
First line
Second line (two trailing spaces above)
Or use a backslash at end of line\
to force a line break.
Soft wrap without break:
just continue on the next line
and it joins into one.Comments
Markdown has no official comment syntax, but HTML comments (<!-- -->) work in most renderers and are hidden in output. The [//]: # trick uses an empty link reference to add notes. Comments are still visible in the raw source.
<!-- HTML comments work in most Markdown -->
[//]: # (This is a comment)
[//]: # "Another comment style"
<!--
Multi-line comment
not rendered in output
-->Whitespace & Indentation
Four leading spaces turn text into a code block — beware accidental indentation. Indentation matters for nested lists (2-4 spaces per level). Tabs are usually treated as 4 spaces. Use spaces consistently to avoid rendering issues across parsers.
Paragraph one.
This is an indented code block
because of 4 spaces.
> Quoted text needs > prefix.
Three spaces is just text
(less than 4).Horizontal Rules
Three or more hyphens, asterisks, or underscores create a horizontal rule (<hr>). Hyphens are most common. Spaces between characters are allowed. For clarity, put blank lines around horizontal rules. Avoid confusing --- (rule) with # (heading).
---
***
___
* * *
Text above
---
Text belowText Formatting
Bold & Strong
Double asterisks or underscores produce bold (<strong>). Asterisks are preferred since underscores do not work mid-word (snake_case). You can nest other emphasis inside bold. HTML <strong> tags work as a fallback.
**bold text**
__also bold__
**bold with *italic* inside**
<strong>HTML bold also works</strong>
**bold**Italic & Emphasis
Single asterisks or underscores create italic (<em>). Asterisks work mid-word; underscores treat word-internal underscores as literal (so no_italic_here). Use <em> as a fallback. Italic is for emphasis, not just styling.
*italic text*
_also italic_
*italic*
<em>HTML italic</em>
normal *italic* normalBold + Italic Combined
Triple asterisks/underscores produce both bold and italic. You can also nest them: bold containing italic or vice versa. Order does not matter for rendering but should be consistent for readability.
***bold and italic***
___also both___
**_bold and italic_**
*__bold and italic__*
combine **bold** and *italic*Strikethrough
Double tildes (~~) create strikethrough, part of GitHub Flavored Markdown and now widely supported. The HTML <del> and <s> tags are equivalent fallbacks. Standard (original) Markdown does not include strikethrough.
~~strikethrough~~
~~crossed out text~~
<del>HTML delete</del>
<s>HTML strikethrough</s>
~~done~~ and ~~pending~~Mark / Highlight
Double equals (==) for highlighting is an extension supported by some parsers (not in GFM core). The HTML <mark> tag works universally. Use highlighting sparingly to draw attention to key terms — overuse reduces its effect.
==highlighted text==
<mark>HTML mark</mark>
This is ==important== text.
Compare **bold**, *italic*, ==mark==.Subscript & Superscript
Tilde (subscript) and caret (superscript) syntax (~ ~ and ^ ^) are extensions not in standard Markdown or GFM — supported by Pandoc, R Markdown, and a few others. For universal support, use HTML <sub> and <sup> or Unicode characters.
H~2~O is water
E = mc^2^
x^2^ + y^2^ = r^2^
1st^st^ January
CO~2~ emissionsLists
Unordered Lists
Use -, *, or + for unordered list items — pick one and be consistent (- is most common). Indent 2-4 spaces for nested items. Mixing markers in the same list can cause issues in some parsers. One item per line.
- item one
- item two
- item three
* asterisk works too
+ plus sign also works
- sub-item (indent 2 spaces)
- another sub-itemOrdered Lists
Ordered lists use numbers followed by periods. The actual numbers do not need to be sequential — Markdown renumbers them. To start at a specific number, use that number first (10. starts at 10). Use 1. for all items to auto-number.
1. first
2. second
3. third
1. auto-numbered
1. still increments
1. third item
10. starts at 10
11. nextNested Lists
Indent nested list items by 2-4 spaces (4 is safest for mixed types). You can mix ordered and unordered lists at different levels. Deep nesting (3+ levels) hurts readability — consider restructuring. Keep indentation consistent.
1. top level
- nested unordered
- second nested
2. back to top
1. nested ordered
2. another
3. third top
- fruits
- apple
- granny smith
- bananaTask Lists
Task list syntax (- [x] and - [ ]) is a GitHub Flavored Markdown extension. The checkbox renders as interactive on GitHub/GitLab. Works with both ordered and unordered lists. Great for READMEs, issue trackers, and progress tracking.
- [x] completed task
- [ ] incomplete task
- [ ] another todo
1. [x] done
2. [ ] not done
- [x] Write the docs
- [ ] Review PR
- [ ] DeployLoose vs Tight Lists
If list items are separated by blank lines, the list is 'loose' (each item wrapped in <p>). Without blank lines, it is 'tight' (no <p> wrappers). This affects spacing in HTML output. Add blank lines deliberately to control paragraph wrapping.