Markdown Formatting: The Complete Guide
Everything you can do with markdown formatting in one place. Text styling, structure, code, tables, links, and more with examples and copy-paste templates.
Last updated: February 27, 2026
Markdown gives you a full set of formatting tools using plain-text symbols. This guide covers every formatting option available in standard markdown and GitHub Flavored Markdown (GFM), organized by category with copy-paste examples.
Text Formatting
Bold, Italic, and Strikethrough
**bold text***italic text****bold and italic***~~strikethrough~~Use asterisks over underscores. Asterisks work mid-word (un**frigging**believable), underscores do not in GFM.
See the bold and italic guide for edge cases and platform differences.
Subscript and Superscript
Standard markdown does not support subscript or superscript. Use HTML:
H<sub>2</sub>OE = mc<sup>2</sup>GitHub strips some HTML tags but allows <sub> and <sup>. Not all platforms support this.
Highlighting
Only Obsidian supports ==highlighted text== natively. For other platforms, use HTML:
<mark>highlighted text</mark>GitHub strips the <mark> tag, so this only works in tools that allow raw HTML.
Document Structure
Headings
Six levels from # to ######:
# Title (H1)## Section (H2)### Subsection (H3)#### Sub-subsection (H4)One H1 per document. Start body sections at H2. See the headings guide for anchor IDs and TOC generation.
Paragraphs and Line Breaks
Paragraphs are separated by blank lines. A single newline does not start a new paragraph.
For a hard line break within a paragraph, end a line with two spaces or use <br>:
Line one with two trailing spacesLine two appears below it.
Or use a break tag:<br>Next line.The two-trailing-spaces approach is invisible and error-prone. The <br> tag is explicit and recommended when you genuinely need a line break without a new paragraph.
Horizontal Rules
Three or more dashes, asterisks, or underscores:
---***___All three produce the same output. Dashes are the most common convention.
Blockquotes
Prefix lines with >:
> This is a blockquote.>> Second paragraph in the same blockquote.Nested blockquotes use >>. See the blockquotes guide for admonitions and creative uses.
Links and Images
Links
[Visible text](https://example.com)[With title](https://example.com "Title text")<https://example.com>See the links guide for reference-style links, anchor links, and email links.
Images
For sizing, use HTML: <img src="photo.png" alt="Alt" width="300" />.
See the images guide for captions, linked images, and platform differences.
Lists
Unordered Lists
- Item one- Item two - Nested itemOrdered Lists
1. First2. Second3. ThirdTask Lists (GFM)
- [x] Done- [ ] PendingSee the lists guide for nesting rules and the task lists guide for checklists.
Code
Inline Code
Use `npm install` to install packages.Fenced Code Blocks
```javascriptconst x = 42;```Add a language identifier after the opening backticks for syntax highlighting. See the code blocks guide for the full language list.
Indented Code Blocks
Indent by four spaces:
function hello() { return "world"; }Fenced code blocks are preferred because they support language hints and are easier to manage.
Tables (GFM)
| Left | Center | Right ||:-------|:------:|------:|| a | b | c || d | e | f |Column alignment: :--- left, :---: center, ---: right. See the tables guide for advanced formatting.
Advanced Formatting
Footnotes (GFM)
A claim that needs a source[^1].
[^1]: Source: https://example.comSee the footnotes guide for multi-paragraph footnotes and platform support.
Escape Characters
Use a backslash to display literal markdown symbols:
\*not italic\*\# not a heading\[not a link\]See the escape characters guide for the complete list.
HTML in Markdown
When markdown does not cover what you need, use raw HTML:
<details><summary>Click to expand</summary>
Hidden content here.
</details>Common uses: collapsible sections, keyboard shortcuts (<kbd>), colored text, custom alignment. See the HTML in markdown guide for what tags work on each platform.
Emoji (GFM)
GitHub supports emoji shortcodes:
:fire: :rocket: :white_check_mark:Not all platforms render shortcodes. Unicode emoji work everywhere:
Great job! 🎉See the emoji guide for a shortcode reference.
Formatting Reference Table
| Element | Syntax | Standard? |
|---|---|---|
| Bold | **text** | Yes |
| Italic | *text* | Yes |
| Bold italic | ***text*** | Yes |
| Strikethrough | ~~text~~ | GFM |
| Inline code | `code` | Yes |
| Code block | ``` with language | GFM |
| Link | [text](url) | Yes |
| Image |  | Yes |
| Heading | # Text | Yes |
| Blockquote | > text | Yes |
| Unordered list | - item | Yes |
| Ordered list | 1. item | Yes |
| Task list | - [x] item | GFM |
| Table | Pipes + dashes | GFM |
| Footnote | [^1] | GFM |
| Horizontal rule | --- | Yes |
| Escape | \* | Yes |
FAQ
What formatting is available in standard markdown vs GFM?
Standard markdown (CommonMark) supports headings, bold, italic, links, images, code, lists, blockquotes, and horizontal rules. GFM adds tables, task lists, strikethrough, auto-linking, footnotes, and fenced code blocks with language hints.
How do I format text as both bold and italic?
Use triple asterisks: ***bold and italic***. This works on all markdown platforms.
Can I change text color in markdown?
Not with standard syntax. Some platforms allow HTML: <span style="color: red">red text</span>. GitHub strips style attributes, so this is not portable. In general, markdown is not designed for custom colors.
How do I create a line break without a new paragraph?
End a line with two spaces and press Enter, or use <br>. The <br> approach is more visible and less error-prone.
Try It Out
Test any formatting in the MDtoLink editor with live preview. When your document looks right, publish it to a shareable URL with one click.
For the quick-reference version, see the markdown cheat sheet.
Founder, MDtoLink
David builds developer tools and writes about markdown workflows, documentation, and AI-assisted publishing.
Publish your markdown to a shareable URL
One command. Free to start. No credit card.