Markdown Cheatsheet

The complete reference guide to markdown syntax. Learn every element, see examples, and export as a PDF cheatsheet for offline use.

Save This Cheatsheet as PDF →

What Is Markdown?

Markdown is a lightweight markup language that lets you write formatted text using plain text syntax. Created by John Gruber in 2004, it was designed to be easy to read and write in its raw form while still being convertible to HTML and other output formats. Today, markdown is the de facto standard for documentation, readme files, forum posts, notes, and countless other writing contexts across the web. GitHub, Reddit, Stack Overflow, Notion, Obsidian, and virtually every developer tool supports markdown. Its beauty lies in its simplicity — you can learn the entire syntax in minutes and write beautifully structured documents without ever touching a formatting toolbar.

Markdown Elements Reference

Headings

Use one to six # symbols before your heading text. # H1 is the largest, ###### H6 is the smallest. Always put a space between the # and the text.

Bold and Italic

Wrap text in **double asterisks** or __double underscores__ for bold. Use *single asterisks* or _single underscores_ for italic. Combine them with ***triple*** for bold italic.

Lists

For unordered lists, use -, *, or + followed by a space. For ordered lists, use numbers followed by a period like 1.. Indent items with two spaces to create nested sub-lists.

Links and Images

Links use the format [link text](url). Images use ![alt text](image-url). You can also use reference-style links by defining [label]: url elsewhere in the document.

Code

Use single backticks `code` for inline code. Use triple backticks ``` for code blocks. Optionally specify a language after the opening backticks for syntax highlighting, like ```javascript.

Tables

Create tables using pipes and dashes: | Col 1 | Col 2 | on the header row, | ----- | ----- | on the separator row, and | Cell 1 | Cell 2 | for data rows. Add colons in the separator row to align text: :--- for left, :---: for center, ---: for right.

Blockquotes

Use > before a line to create a blockquote. Nest blockquotes by using multiple >> symbols. Blockquotes are perfect for quoting external sources or highlighting important notes.

Horizontal Rules

Use three or more dashes ---, asterisks ***, or underscores ___ on their own line to create a horizontal rule.

How to Save This Cheatsheet as PDF

  1. Copy the markdown examples from this page or write your own cheatsheet document in markdown format.
  2. Open md2pdf in your browser. The markdown editor loads with sample content you can replace.
  3. Paste your markdown into the editor. The preview panel on the right updates in real time as you type.
  4. Click Export PDF to generate a beautiful PDF that preserves all your headings, lists, tables, and code blocks.

Why Learn Markdown?

Markdown is one of the highest-leverage skills a knowledge worker can learn. It is used everywhere — GitHub README files, Notion documents, Obsidian notes, Reddit posts, Stack Overflow answers, Dev.to articles, Jupyter notebooks, static site generators like Jekyll and Hugo, and much more. Once you know markdown, you can write formatted content in any of these platforms without learning a new interface each time. Markdown is also future-proof: your raw markdown files are plain text that will be readable in any text editor for decades to come, unlike proprietary formats that may become obsolete. And because markdown documents are smaller and simpler than Word or Google Docs files, they are ideal for version control with git, collaboration via pull requests, and automated processing in CI/CD pipelines.

Frequently Asked Questions

What is markdown?

Markdown is a lightweight markup language created by John Gruber in 2004. It uses plain text formatting syntax that can be converted to HTML and other formats. It is designed to be easy to read and write in its raw form.

How do I create a heading in markdown?

Use the # symbol followed by a space. One # for an H1, two for H2, and so on up to six for H6. Example: # Heading 1, ## Heading 2.

Can I create tables in markdown?

Yes. Use pipes and dashes to create tables. For example: | Header 1 | Header 2 | followed by | ------- | ------- | and then | Cell 1 | Cell 2 | on each row. Align columns with colons in the separator row.

How do I add code blocks in markdown?

Use triple backticks ``` before and after the code block. Optionally specify a language after the opening triple backticks for syntax highlighting, like ```python or ```javascript.

How can I convert a markdown cheatsheet to PDF?

Use the md2pdf free online tool. Copy your markdown content, paste it into the editor, and click Export PDF. The PDF will preserve all formatting including headings, lists, tables, and code blocks.