The Complete Markdown Guide
Syntax, Use Cases, and Best Practices
13 min read • Updated March 2026
What Is Markdown?
Markdown is a lightweight markup language created by John Gruber and Aaron Swartz in 2004. It uses plain-text formatting syntax that converts to HTML — the philosophy being that a Markdown document should be readable as-is, without looking like it's been marked up with tags or formatting instructions.
The name is a play on "markup" — instead of marking text up with tags (like HTML does), Markdown keeps documents readable while adding structure through minimal, intuitive punctuation. A heading is created with #, bold text with **asterisks**, and links with [text](url) notation.
Markdown has become ubiquitous in technical writing and development contexts. GitHub renders Markdown automatically in READMEs, issues, and comments. Stack Overflow, Reddit, Discord, Slack, Notion, Obsidian, and countless other platforms support Markdown formatting. Understanding Markdown is increasingly a baseline skill for anyone working in technical fields.
Quick comparison — the same heading in three formats:
<h1>My Heading</h1># My HeadingBasic Syntax Reference
Headings
# Heading 1 (largest)
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6 (smallest)Headings create a document hierarchy. H1 is typically used once per page as the main title; H2 for major sections; H3 and below for subsections.
Emphasis
**Bold text** or __Bold text__
*Italic text* or _Italic text_
***Bold and italic*** or ___Bold and italic___
~~Strikethrough text~~Lists
Unordered list:
- First item
- Second item
- Nested item (2 spaces or tab indent)
- Another nested item
- Third item
Ordered list:
1. First item
2. Second item
3. Third item
Task list (GitHub Flavored Markdown):
- [x] Completed task
- [ ] Incomplete taskLinks and Images
[Link text](https://example.com)
[Link with title](https://example.com "Hover tooltip")


Reference-style links:
[Link text][reference-name]
[reference-name]: https://example.com "Optional title"Blockquotes and Horizontal Rules
> This is a blockquote.
> It can span multiple lines.
>
> > Nested blockquotes are also possible.
---
(Three dashes, asterisks, or underscores create a horizontal rule)Inline Code and Code Blocks
Inline code: Use `backticks` for inline code.
Fenced code block with syntax highlighting:
```javascript
function hello(name) {
console.log(`Hello, ${name}!`);
}
```Extended Syntax (Tables, Code, Footnotes)
Extended Markdown syntax adds features beyond the original spec. Most modern platforms support these extensions, particularly GitHub Flavored Markdown (GFM).
Tables
| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Cell A | Cell B | Cell C |
| Cell D | Cell E | Cell F |
Alignment:
| Left | Center | Right |
|:-----|:------:|------:|
| text | text | text |Tables are supported in GitHub Flavored Markdown and most modern Markdown renderers. The alignment row (:--- for left, :---: for center, ---: for right) is required for tables to render correctly.
Footnotes
Here's a sentence with a footnote.[^1]
[^1]: This is the footnote content.Definition Lists
Term
: Definition of the term.
Another Term
: First definition.
: Second definition.Collapsible Sections (HTML in Markdown)
Standard Markdown doesn't support collapsible sections, but platforms that render HTML-in-Markdown (like GitHub) support the HTML <details> element:
<details>
<summary>Click to expand</summary>
This content is hidden until the summary is clicked.
You can include **Markdown** inside.
</details>Markdown Flavors: CommonMark, GFM, and Others
One of Markdown's persistent frustrations is that there is no single definitive standard. The original specification by John Gruber left many ambiguities, and different platforms implemented extensions and resolved ambiguities differently. This led to the proliferation of "Markdown flavors."
CommonMark
A standardization effort to eliminate Markdown ambiguities with a formal, tested spec. CommonMark is increasingly the baseline that other flavors build on. If you're building a Markdown parser or need consistent behavior across environments, target CommonMark.
GitHub Flavored Markdown (GFM)
GFM extends CommonMark with tables, task lists, strikethrough, autolinks, and syntax-highlighted code blocks. Since GitHub is the most popular platform for technical writing and documentation, GFM is effectively the most widely supported Markdown dialect. GFM also supports HTML within Markdown.
MDX, MultiMarkdown, and Others
MDX (Markdown + JSX) allows embedding React components in Markdown, popular in documentation sites. MultiMarkdown adds footnotes, definition lists, and metadata. Pandoc Markdown is the richest flavor, supporting academic writing features like citations. Each platform's Markdown may differ — always check the documentation of the specific system you're writing for.
How Markdown Becomes HTML
Markdown is always transformed into HTML by a parser before being displayed. Understanding this transformation helps you predict how your Markdown will render and debug rendering issues.
Markdown → HTML transformation:
Markdown input:
# Hello World
**Bold** and *italic*
- Item 1
- Item 2
[Link](https://example.com)HTML output:
<h1>Hello World</h1>
<p><strong>Bold</strong> and
<em>italic</em></p>
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
<p><a href="https://example.com">
Link</a></p>This is why understanding HTML fundamentals helps with Markdown — you can often predict or explain Markdown behavior by thinking about the HTML it will produce. Conversely, in Markdown flavors that support HTML-in-Markdown, you can embed raw HTML for features Markdown doesn't support natively.
When to Use Markdown
Markdown excels in contexts where documents need to be both human-readable as plain text and rendered with formatting. Here's where it genuinely shines:
Strong fit
- ✓ README files and project documentation
- ✓ GitHub issues, PRs, and comments
- ✓ Technical blog posts and articles
- ✓ Changelogs and release notes
- ✓ Developer documentation sites (Docusaurus, MkDocs)
- ✓ Notion, Obsidian, and note-taking apps
- ✓ Slack, Discord, and chat platforms
Poor fit
- ✗ Complex page layouts with positioning
- ✗ Documents needing precise typography control
- ✗ Print-ready formatted documents (use LaTeX or Word)
- ✗ Dynamic, interactive content
- ✗ Documents requiring complex form fields or surveys
- ✗ Pixel-perfect design deliverables
Best Practices
Use one H1 per document
The H1 heading is the document title. Use H2 for major sections, H3 for subsections — maintain a logical hierarchy that both humans and screen readers can navigate.
Keep lines under 80-120 characters
In version control, shorter lines make diffs more readable. Many style guides recommend wrapping at 80 characters for prose. Editors with word-wrap can display any line length, but shorter lines work better in terminal environments.
Use reference-style links for complex documents
When a document has many links, inline links can make the raw text hard to read. Reference-style links separate the URL from the text, keeping paragraphs clean and making the raw Markdown easier to read and maintain.
Always specify the language for code blocks
Code blocks with an explicit language identifier (```javascript) get proper syntax highlighting in most renderers. Without it, code renders as plain text. Even for unknown languages, using a descriptive identifier helps readers and linters.
Write meaningful alt text for images
The alt text in  is read by screen readers and shown when images fail to load. Write descriptive alt text that conveys the image's meaning and context, not just its appearance. "Graph showing monthly revenue growth" is better than "graph" or "image".
Markdown Tools
Write and preview Markdown directly in your browser:
Markdown Editor
Write Markdown with a live side-by-side preview. Export to HTML.
Markdown Preview
Paste Markdown and see the rendered HTML output instantly.
Markdown to HTML Converter
Convert Markdown documents to clean, formatted HTML.
HTML to Markdown Converter
Convert HTML content to clean, readable Markdown format.
Markdown Table Generator
Generate Markdown table syntax from a visual table editor.
Word Counter
Count words, characters, and reading time for Markdown content.