Skip to main content
HomeCheat sheetsData Science

Markdown Cheat Sheet

Learn everything you need to know about Markdown in this convenient cheat sheet!
Oct 2023

Have this cheat sheet at your fingertips

Download PDF

Formatting Text Spans

Surround text with a single asterisk or underscore for emphasis (italics)

she thought in *italics*

she thought in _italics_

she thought in italics

Surround text with double asterisks or underscores to make it bold

to **boldly** go

to __boldly__ go

to boldly go

Boldness and emphasis can be nested for bold-italic text

**Boldness has *genius*, _power_, and *magic*** in it

Boldness has genius, power, and magic in it

Surround text with one of more backticks to make it code

Should I use `pandas` or `dplyr`?

Should I use pandas or dplyr?

Surround text with one of more tildes to strike it through

Every strike brings me ~closer to~ the next home run

Every strike brings me closer to the next home run

Surround text with a single dollar sign to make it a LaTeX equation

$e^{\pi i} + 1 = 0$

Formatting Text Blocks

Start a line with greater than then space to make it a quote

> Without data you're just

> another person with an opinion

Without data you're just another person with an opinion

Surround a block of text with lines starting with three backticks to make it a code block

```

x = (1 + sqrt(5)) / 2

```

x = (1 + sqrt(5)) / 2

Optionally specify the language of the code after the backticks to highlight syntax

``` python

x = (1 + sqrt(5)) / 2

```

x = (1 + sqrt(5)) / 2

Lists

Start lines with hyphens, plus or asterisks then a space to make an unordered list

(Be consistent about which punctuation is used)

- bread

- milk

- eggs

- teabags

  • bread
  • milk
  • eggs
  • teabags

Start lines with a number followed by a period then a space to make an ordered list.

(Numbering is automatic and follows from the first element.)

3. three

1. four

1. five

1. six

  1. three
  2. four
  3. five
  4. six

Inside a list, include square brackets filled with a space or character (conventionally 'x') to create a checklist

- [x] bread

- [ ] milk

- [x] eggs

- [ ] teabags

 

Use space indentation to nest lists

* The Lord of the Rings

1. The Fellowship of the Ring

1. The Ring Sets Out

1. The Ring Goes South

1. The Two Towers

1. The Treason of Isengard

1. The Ring Goes East

1. The Return of the King

1. The War of the Ring

1. The End of the Third Age

  • The Lord of the Rings
  1. The Fellowship of the Ring
    1. The Ring Sets Out
    2. The Ring Goes South
  2. The Two Towers
    1. The Treason of Isengard
    2. The Ring Goes East
  3. The Return of the King
    1. The War of the Ring
    2. The End of the Third Age

Headings

Start a line with one to six hashes then a space to make it a heading

# Constitution of the United States

## Articles

### Article I: The Legislative Branch

#### Section 1: The Legislature

Constitution of the United States

Articles

Article I: The Legislative Branch

Section 1: The Legislature

For level one headings, you can also follow the line with a line of equals signs

Constitution of the United States

=================================

Constitution of the United States

For level two headings, you can also follow the line with a line of hyphens

Articles

--------

Articles

Links, Images and Footnotes

Use square brackets containing link text followed by parentheses containing a URL to include a hyperlink

[Build data and AI skills with DataCamp](https://www.datacamp.com)

Build data and AI skills with DataCamp

Use square brackets containing link text followed by a reference number, then (usually at the bottom of the doc) square brackets containing the reference number followed by a colon then a space then a URL to include reference-style hyperlinks.

[Listen to DataFramed][1]

[1]: https://www.datacamp.com/podcast

Listen to DataFramed

Use an exclamation mark followed by square brackets containing alt text followed by parentheses containing a URL or path to a file to include an image

![The Markdown logo](Markdown-mark.png)

The Markdown logo

Use square brackets containing a caret then a number (both within the content and at the foot of the page) to create a footnote.

Literature is the original Internet – every footnote, every citation, every allusion is essentially a hyperlink to another text, to another mind.[^1]

[^1]: Attributed to Maria Popova

Tables

Use pipes to delimit columns in a table. Use hyphens to separate the header from the content. Use a colon to the left or right of those hyphens to indicate column alignment.

| Sepal Length| Sepal Width| Petal Length| Petal Width|      Species |

|-----------------:|----------------:|-----------------:|---------------:|:---------------|

|                 5.1|                3.3|                  1.7|              0.5|        setosa |

|                4.8|                3.0|                  1.4|              0.1|        setosa |

|                 6.1|                2.8|                 4.7|               1.2|   versicolor |

|                 6.1|                3.0|                 4.6|               1.4|  versicolor |

Sepal Length

Sepal Width

Petal Length

Petal Width

Species

5.1

3.3

1.7

0.5

setosa

4.8

3.0

1.4

0.1

setosa

6.1

2.8

4.7

1.2

versicolor

6.1

3.0

4.6

1.4

versicolor

Breaks

Have a line with only three or more hyphens, asterisks, or underscores (plus optional spaces) to include a horizontal rule.

---

***

___

By default, text on consecutive lines flows as a single line.

Writing one line,

then another without a break,

results in text flowing as a single line.

Writing one line, then another without a break, results in text flowing as a single line.

Two spaces at the end of a line result in a line break.

Appending two spaces to the end of the line¶¶

creates a line break.

Appending two spaces to the end of the line

creates a line break.

Blank lines create a new paragraph.

Including a blank line in between two lines of text

creates a paragraph break.

Including a blank line in between two lines of text

creates a paragraph break.

Topics
Related

The Complete Docker Certification (DCA) Guide for 2024

Unlock your potential in Docker and data science with our comprehensive guide. Explore Docker certifications, learning paths, and practical tips.
Matt Crabtree's photo

Matt Crabtree

8 min

Mastering API Design: Essential Strategies for Developing High-Performance APIs

Discover the art of API design in our comprehensive guide. Learn how to create APIs like Google Maps API with best practices in defining methods, data formats, and integrating security features.

Javeria Rahim

11 min

Data Science in Finance: Unlocking New Potentials in Financial Markets

Discover the role of data science in finance, shaping tomorrow's financial strategies. Gain insights into advanced analytics and investment trends.
 Shawn Plummer's photo

Shawn Plummer

9 min

5 Common Data Science Challenges and Effective Solutions

Emerging technologies are changing the data science world, bringing new data science challenges to businesses. Here are 5 data science challenges and solutions.
DataCamp Team's photo

DataCamp Team

8 min

A Data Science Roadmap for 2024

Do you want to start or grow in the field of data science? This data science roadmap helps you understand and get started in the data science landscape.
Mark Graus's photo

Mark Graus

10 min

Introduction to DynamoDB: Mastering NoSQL Database with Node.js | A Beginner's Tutorial

Learn to master DynamoDB with Node.js in this beginner's guide. Explore table creation, CRUD operations, and scalability in AWS's NoSQL database.
Gary Alway's photo

Gary Alway

11 min

See MoreSee More