reStructuredText vs Markdown: Quick Reference

A side-by-side syntax reference for both markup languages.

Note

Tags marked [same] use identical or near-identical syntax in both languages. Tags marked [different] have meaningfully different syntax. Markdown notes apply primarily to CommonMark / GitHub Flavored Markdown (GFM) unless otherwise stated.

Inline Formatting

Italic [same]

reStructuredText Markdown
*italic* *italic* or _italic_

Bold [same]

reStructuredText Markdown
**bold** **bold** or __bold__

Bold Italic

reStructuredText Markdown
Not supported natively ***bold italic***

Inline Code [similar]

reStructuredText Markdown
``code`` `` code ``
Double backticks Single backtick

Strikethrough

reStructuredText Markdown
Not natively; use role ~~text~~
or raw HTML (GFM / extended)

Headings

H1

reStructuredText Markdown
Title
# Title
=====
 
Underline with = (length must match)
 

H2

reStructuredText Markdown
Section
## Section
-------
 
Underline with - (or any punctuation
 
character, used consistently)
 

H3

reStructuredText Markdown
Subsection
### Subsection
~~~~~~~~~~
 
Tilde or any new punctuation character
 

Overline Variant

reStructuredText Markdown
==========
Not supported
Title
 
==========
 
Overline + underline for top level
 

Lists

Unordered List [similar]

reStructuredText Markdown
- item - item
- item - item
- item - item
Also * or + Also * or +

Ordered List [similar]

reStructuredText Markdown
1. first 1. first
2. second 2. second
3. third 3. third
Also #. for  
auto-numbering  

Nested List

reStructuredText:

- item

  - nested

- item

Blank line + 2-space indent required.

Markdown:

- item
  - nested
- item

Indent with 2–4 spaces.

Definition List

reStructuredText Markdown
term
Not standard; use HTML
`` Definition text here.``
or an extension
Indented definition follows term
 

Code Blocks

Basic Code Block

reStructuredText:

::

   code here

``::`` at end of paragraph, indent 3+ spaces.

Markdown:

```
code here
```

Fenced with triple backticks.

Code Block with Language

reStructuredText:

.. code-block:: python

   import sys

Markdown:

```python
import sys
```

Include External File

reStructuredText:

.. literalinclude:: file.py
   :language: python

Markdown: Not supported natively.

Block Elements

Blockquote

reStructuredText Markdown
Indent with spaces``::`` > Quoted text here. > Continues here.
Indented text becomes  
a block quote.  

Horizontal Rule

reStructuredText Markdown
---- --- or ***
Four or more dashes Three or more -/*/_ on their own line

Line Break

reStructuredText:

| line one
| line two

Line blocks using ``|`` prefix.

Markdown:

line one
line two

Two trailing spaces before the newline.

Note / Admonition

reStructuredText:

.. note::

   Content of the note.

Also: ``warning::``, ``tip::``, ``caution::``

Markdown: No standard syntax; use raw HTML or a tooling-specific extension.

Tables

Simple Table

reStructuredText:

===  ===
A    B
===  ===
1    2
===  ===

``===`` delimiters.

Markdown (GFM pipe table):

| A | B |
|---|---|
| 1 | 2 |

Grid Table (full)

reStructuredText:

+---+---+
| A | B |
+===+===+
| 1 | 2 |
+---+---+

Supports cell spans and multi-line cells.

Markdown: Not supported.

Column Alignment

reStructuredText:

.. list-table::
   :widths: 25 75
   :header-rows: 1

Markdown:

| L  |  C  |  R |
|:---|:---:|---:|

Colon placement in the separator row controls alignment.

Advanced / Special

Comment

reStructuredText Markdown
.. This is a comment No standard comment syntax
.. with no directive name  

Footnote

reStructuredText:

text [1]_

.. [1] Footnote text.

Markdown (GFM / Pandoc):

text [^1]

[^1]: Footnote text.

Table of Contents

reStructuredText:

.. contents:: TOC Title
   :depth: 2

Markdown: Tooling-dependent (Pandoc, MkDocs, etc.).

Substitution / Macro

reStructuredText:

|release|

.. |release| replace:: 5.0

Markdown: Not supported.

Raw HTML

reStructuredText:

.. raw:: html

   <div>...</div>

Markdown:

<div>HTML inline</div>

Most renderers allow raw HTML directly.

Math

reStructuredText:

.. math::

   E = mc^2

Markdown (extended / KaTeX / Pandoc):

$$E = mc^2$$

Directive (Generic)

reStructuredText:

.. directive-name:: arg
   :option: value

   Content block.

Markdown: No equivalent; use extensions or tooling-specific shortcodes.

Key Differences Summary

Where RST is more powerful

  • Headings: flexible punctuation characters rather than # levels.
  • Tables: full grid tables with cell spans and multi-line cells.
  • Admonitions: .. note::, .. warning::, .. tip:: etc. built in.
  • Directives: a general extension mechanism for any block-level construct.
  • Substitutions / macros: reusable text snippets.
  • Standardisation: RST via Docutils/Sphinx is much more uniform than Markdown.

Where Markdown is simpler or has wider support

  • Fenced code blocks: triple backticks are more readable than :: + indentation.
  • Raw HTML: allowed inline without a directive in most renderers.
  • Strikethrough and footnotes: widely available in GFM.
  • Popularity: GitHub, Stack Overflow, Reddit, and most wikis default to Markdown.

The Markdown fragmentation caveat

There is no single Markdown standard. CommonMark is the closest thing to a specification, but GitHub Flavored Markdown (GFM), Pandoc, MkDocs, and Obsidian each add their own extensions. RST via Docutils/Sphinx is substantially more uniform across toolchains.

Published by Pierre Bernatchez in «mark up languages». Key Words: reStructuredText, markdown, cheatsheet, pelican