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.

· · 8 min read

Last updated: February 27, 2026

markdown formatting guide

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>O
E = 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 spaces
Line 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.

[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

![Alt text](/images/photo.png)
![Alt text](/images/photo.png "Title")

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 item

Ordered Lists

1. First
2. Second
3. Third

Task Lists (GFM)

- [x] Done
- [ ] Pending

See 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

```javascript
const 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.com

See 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

ElementSyntaxStandard?
Bold**text**Yes
Italic*text*Yes
Bold italic***text***Yes
Strikethrough~~text~~GFM
Inline code`code`Yes
Code block``` with languageGFM
Link[text](url)Yes
Image![alt](url)Yes
Heading# TextYes
Blockquote> textYes
Unordered list- itemYes
Ordered list1. itemYes
Task list- [x] itemGFM
TablePipes + dashesGFM
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.


David Schemm
David Schemm

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.