A Handy Markdown Cheat Sheet for Beginners and Experts

Markdown is a lightweight markup language that enables you to format text using a plain text editor. It offers a simple and readable way to add styling to your writing without complex word processors. 

This Markdown cheat sheet provides a quick reference to the syntax, helping you remember formatting rules efficiently. All Markdown applications support the basic Markdown syntax. This makes a cheat sheet a valuable tool for both beginners and experienced users to quickly look up syntax and enhance their Markdown writing. 

The Essentials Basic Markdown Syntax Cheat Sheet

The following elements form the foundation of the Markdown syntax and are generally supported across all Markdown applications.

Headings

Markdown offers two primary styles for creating headings.

  • Atx style uses se hashtags (#) followed by a space. One # for the biggest heading (H1), ## for H2, and so on, all the way down to ###### for H6.
# This is Heading 1
## This is Heading 2
### This is Heading 3
  • Setext style is used for H1 and H2 headings. For H1, you use a line of two or more equal signs ======== below the heading text. For H2, you use a line of two or more hyphens ——– below the heading text.
Heading 1
=========

Heading 2
---------

Emphasis

You can emphasize text to make it italic or bold.

  • For italic text, wrap your text in single asterisks (*) or underscores (_).
*This text will be italic.*
_This will also be italic._
  • Bold text is created by enclosing the text in double asterisks (**) or double underscores (__).
**This text will be bold.**
__This will also be bold.__
  • For strikethrough use double tildes ~~strike through~~ text, use double tildes (~~).
~~Scratch this.~~

Lists

Markdown supports both unordered and ordered lists.

  • Unordered Lists can be created using asterisk (*), hyphen (-), or plus sign (+) followed by a space before each list item.
* Item 1
- Item 2
+ Item 3
  - Want to nest? Just indent!
  • You can also create checkboxes in unordered lists using – [ ] for an unchecked box and – [x] for a checked box.
- [x] Task completed
- [ ] Task pending
  • Ordered Lists are created by starting each list item with a number followed by a period and a space. You can also use letters followed by a period. The actual numbers you use don’t necessarily affect the output; Markdown will order them sequentially.
1. First item
2. Second item
3. Third item
   a. Sub-item A
   b. Sub-item B
  • Nested lists can be created by indenting the sub-list items with spaces.

Links

You can add hyperlinks to your text in a couple of ways.

  • Inline links are created by enclosing the link text in square brackets []followed immediately by the URL in parentheses(). You can also add an optional title that appears on hover by including it in double quotes within the parentheses:
Visit [Google](http://google.com)
Or check out [Squarespace](http://squarespace.com/ "Link Title")
  • Reference-style links involve two parts. First, you add the link text in square brackets followed by a label in another set of square brackets: [link][google]. Then, elsewhere in your document (often at the bottom), you define the link using the label, a colon, the URL, and optionally a title in double quotes: [google]: http://google.com “Title”.
Here's a [link to Google][google].
And another [one to Squarespace][sqsp].

[google]: http://google.com
[sqsp]: http://squarespace.com/ "Optional Title Here"
  • You can also simply enclose a URL in angle brackets < > to make it a link:
<http://google.com>

Images

Adding images follows a similar syntax to links, with an exclamation mark ! preceding the link syntax.

  • Inline images are added using Alt text, where alt text describes the image.[Alt text describes the image](url/to/image.jpg "Optional Title")
![GitHub Logo](/images/logo.png "The GitHub Octocat")
  • Reference-style images use ![alt text][logo] followed by [logo]: /images/logo.png “Logo Title” to define the image elsewhere.
![GitHub Logo][logo]

[logo]: /images/logo.png "The GitHub Octocat"
  • You can also create images with links by nesting the image Markdown within the link Markdown:
[![Alt Text Here](image_url.jpg)](link_url.com)

Blockquotes

To create a blockquote, use the sign > character at the beginning of a line. You can also nest blockquotes by using multiple > characters. Lists can also be quoted within blockquotes.

> This is a blockquote. It stands out from the rest of the text.
>
> You can have multiple paragraphs.

> You can even nest them!
>> Like this!
>
> > And quote lists too:
> > 1. Item one
> > 2. Item two

Code

Markdown provides ways to format code snippets.

  • Inline code is enclosed in backticks inline code. You can include literal backticks by using double backticks around them: `like this`
  • Code blocks use for longer code examples, use triple backticks (“`) or triple tildes (~~~) before and after the code block. You can also add a language identifier right after the opening ticks for syntax highlighting in many Markdown renderers. Indenting by four spaces also works for creating code blocks.
```javascript
function greet(name) {
  console.log(`Hello, ${name}!`);
}
body {
  font-family: sans-serif;
}
  // This line is indented by four spaces
  // So it's also a code block.

Horizontal Rules (Dividing Sections)

Need a visual break? Easy peasy. Use three or more hyphens (---), asterisks (***), or underscores (___) on a line by themselves.

Some text here...

---

More text here...

***

And a final section.
___

Going Further: Extended Markdown Syntax

Okay, those are the basics that work almost everywhere. But lots of Markdown applications (like GitHub Flavored Markdown, or GFM) support extra features. Here are some common ones you might find useful:

  • Tables: These can seem tricky, but they’re powerful. Use pipes | to separate columns and hyphens - to create the header separator. Use colons : for alignment.
| Header 1 | Header 2 (Centered) | Header 3 (Right) |
| :------- | :-----------------: | ---------------: |
| Cell 1   | Cell 2              | Cell 3           |
| Cell 4   | Cell 5              | Cell 6           |

Pro Tip: You don’t always need the outer pipes, and tools like tableconvert.com can generate tables for you!

  • Footnotes: Add notes that appear at the bottom. Use [^1] in the text and then define it like this: [^1]: Here's the footnote content.
Here is some text with a footnote[^note].

[^note]: This is the footnote itself.
  • Heading IDs: Sometimes you want to link directly to a specific section. Some Markdown versions let you add a custom ID.
### My Awesome Section {#custom-section-id}
  • Definition Lists: Create lists of terms and their definitions.
Markdown
: A lightweight markup language.

HTML
: HyperText Markup Language.

Task Lists: We saw these briefly under lists, but they’re technically often part of extended syntax. - [x] Done, - [ ] To Do.

Emoji: Who doesn’t love emoji? Many platforms support shortcodes like :smile:, :tada:, or :joy:. 😄🎉😂

Highlighting: Make text stand out ==like this== using double equals signs.

Subscript & Superscript: Useful for formulas or exponents. Use tildes ~ for subscript (H~2~O becomes H₂O) and carets ^ for superscript (X^2^ becomes X²). Sometimes HTML tags (<sup>, <sub>) are also supported (E=MC<sup>2</sup>).

How to Actually Use a Markdown Cheat Sheet

The great thing is, you don’t have to memorize everything! Cheat sheets are everywhere online. Many text editors or platforms with Markdown support even have them built-in.

  • Example: RStudio: If you use RStudio, you can find built-in helpers. Go to Help > Cheatsheets > R Markdown Cheat Sheet or Help > Markdown Quick Reference for a handy guide.
  • Visual Aid: Think of a cheat sheet as a quick visual map of the syntax. Just glance at it when you’re stuck.
  • Offline Access: It’s often super helpful to download a cheat sheet (some sites offer them as PDFs or even .md files you can keep handy).

Oops! How Do I Show a Real Asterisk? Backslash Escapes

What if you actually want to type a character that Markdown uses for formatting, like an asterisk or a backtick, without it triggering the formatting? Just put a backslash \ before it!

I want to show \*this text surrounded by literal asterisks\*, not italics.
And show a literal backtick: \`
Or a literal hash: \#

Common characters you might need to escape include: \, `, *, _, {, }, [, ], (, ), #, +, -, ., !

Wrapping Up: Get Formatting with Markdown!

Markdown really is a fantastic tool for adding formatting to your text without getting tangled up in complex software. It’s simple, readable, and incredibly versatile.

And that cheat sheet? It’s your secret weapon. Keep one bookmarked or downloaded nearby. It genuinely speeds things up, especially when you’re starting out, and helps make writing in Markdown feel effortless. Don’t be afraid to experiment, refer to your cheat sheet often, and just practice. You’ll be a Markdown pro in no time! Happy formatting!

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *