Markdown: The Complete Guide to .md Format
In 2004, John Gruber and Aaron Swartz created Markdown with a simple goal: let people write using plain text that is easy to read and easy to convert to HTML. Two decades later, Markdown has become the dominant format for technical documentation, README files, blogging, note-taking, and online writing — used on GitHub, Stack Overflow, Reddit, Discord, Notion, Obsidian, and hundreds of other platforms. Understanding Markdown means understanding how most technical writing on the internet actually works.
What Is Markdown?
Markdown is a lightweight markup language that uses simple punctuation characters to indicate formatting. A Markdown file has the .md extension (sometimes .markdown). The genius of Markdown is that it is already readable as plain text — the formatting characters are intuitive rather than cryptic:
# This is a heading
This is a paragraph with **bold text**, *italic text*, and `inline code`.
- First list item
- Second list item
- Third list item
1. Ordered item one
2. Ordered item two
[Visit GitHub](https://github.com)

> This is a blockquote
---
| Column 1 | Column 2 |
|----------|----------|
| Cell 1 | Cell 2 |
Core Markdown Syntax
Headings
# H1 — Page or document title
## H2 — Major section
### H3 — Subsection
#### H4 — Sub-subsection
Emphasis
**bold text** or __bold text__
*italic text* or _italic text_
***bold and italic***
~~strikethrough~~
Links and Images
[link text](https://url.com)
[link text](https://url.com "Optional title")
[reference link][ref-id]
[ref-id]: https://url.com


Lists
- Unordered item (use -, *, or +)
- Nested item (indent with 2 or 4 spaces)
- Deeper nesting
1. Ordered item
2. Another item
3. Third item
- [x] Completed task (GitHub Flavored Markdown)
- [ ] Incomplete task
Code
`inline code` — single backticks for inline
```python
# Fenced code block with language specifier
def hello():
print("Hello, Markdown!")
```
Blockquotes
> This is a blockquote
>
> It can span multiple paragraphs
>
> > Nested blockquotes work too
Horizontal Rules
---
or
***
or
___
Tables (GFM extension)
| Header 1 | Header 2 | Header 3 |
|----------|:--------:|----------:|
| Left | Center | Right |
| aligned | aligned | aligned |
Markdown Flavors and Specifications
A key source of Markdown confusion: there is no single standard. John Gruber defined core Markdown syntax but left many edge cases ambiguous, leading to a proliferation of variants:
CommonMark: a strict, unambiguous specification (commonmark.org, 2014). Defines how every edge case should be handled. Many platforms have adopted CommonMark as their base.
GitHub Flavored Markdown (GFM): CommonMark plus tables, task lists, strikethrough, autolinks, and fenced code blocks with syntax highlighting. Used everywhere on GitHub.
MultiMarkdown (MMD): adds footnotes, citation support, metadata, definition lists, math (via MathJax), and cross-references. Popular in academic writing.
Pandoc Markdown: Pandoc's extended dialect with footnotes, citations ([@citation-key]), YAML metadata blocks, grid tables, definition lists, and more. The most powerful Markdown flavor for document conversion.
R Markdown (.Rmd): Markdown + embedded R code chunks that execute when rendered. Used in data science and statistical analysis (R/Python).
MDX: Markdown + JSX React components. Used in modern documentation sites and blogs.
How Markdown Is Converted to HTML
Every Markdown renderer parses the .md file and converts the syntax to HTML elements:
| Markdown | HTML |
|---|---|
# Heading |
<h1>Heading</h1> |
**bold** |
<strong>bold</strong> |
*italic* |
<em>italic</em> |
[link](url) |
<a href="url">link</a> |
 |
<img src="img.jpg" alt="alt"> |
`code` |
<code>code</code> |
The HTML is then styled by CSS (or a design system) to produce the visual output.
Platform-Specific Markdown
GitHub
GitHub renders Markdown in README files, issues, pull requests, comments, and wikis using GFM. Key GFM extensions: fenced code blocks with syntax highlighting, task lists, tables, emoji shortcodes (:smile:), mentions (@username), issue references (#123), SHA hash references.
Stack Overflow
Uses a modified Markdown with code block formatting and HTML stripping for security. Does not support tables in all contexts.
Uses Reddit-flavored Markdown (Old Reddit) or a custom rich text editor (New Reddit). Old Reddit supports standard Markdown; New Reddit converts to a proprietary rich text format internally.
Discord
Uses a subset of Markdown: bold/italic/underline/strikethrough, inline code, code blocks, block quotes, spoiler tags (||spoiler||).
Notion, Obsidian, Bear
Note-taking apps use Markdown as their base with proprietary extensions for backlinks ([[Page Name]]), callouts, and database properties.
Converting Markdown
Markdown → HTML: every Markdown library does this — Marked.js (JavaScript), Python-Markdown, CommonMark parsers in every language.
Markdown → PDF: use Pandoc: pandoc input.md -o output.pdf (requires LaTeX for PDF output) or pandoc input.md --pdf-engine=wkhtmltopdf -o output.pdf
Markdown → Word (.docx): pandoc input.md -o output.docx — produces a properly structured Word document with styles matching Markdown structure
Markdown → Slides: Marp, Reveal.js, or Pandoc with --to revealjs create presentation slides from Markdown
HTML → Markdown: Pandoc: pandoc -f html -t markdown input.html -o output.md; also Turndown (JavaScript), html2text (Python)
Word → Markdown: pandoc input.docx -t markdown -o output.md — useful for migrating content to static site generators
Markdown in Static Site Generators
Markdown is the primary content format for nearly every static site generator:
- Jekyll (GitHub Pages default): processes
.mdfiles with front matter YAML, used by millions of GitHub Pages sites - Hugo: exceptionally fast Markdown processor with shortcodes and templating
- Gatsby, Next.js: React-based, process Markdown via MDX or unified
- MkDocs: Markdown-first documentation sites (used by FastAPI, Pydantic, and many Python libraries)
- Docusaurus: Facebook's documentation framework, MDX-based
- Eleventy (11ty): flexible, supports Markdown, HTML, Liquid, Nunjucks
The static site generator workflow: write content in .md files → generator processes Markdown → outputs static HTML/CSS/JS → deploy to CDN.
Markdown for README Files
The README.md file in a GitHub repository is the face of open-source projects. Best practices:
- Start with a clear project description and badges (build status, license, version)
- Installation instructions with copy-pasteable code blocks
- Quick start example with a code block
- Feature list
- Link to full documentation
- Contributing guidelines and license
Markdown's simplicity — readable as raw text, renders beautifully in browsers — makes it the perfect format for documentation that lives alongside code in version control.
Related conversions
Document conversions that follow this topic naturally: