Markdown Cheatsheet

A quick reference for Markdown syntax — headings, lists, links, code blocks, tables, and more, with live rendered previews.

Markdown
Preview

How to Use

  1. Browse the Table of Contents on the left to jump to any syntax category.
  2. Each card shows the raw Markdown syntax on the left and the rendered output on the right.
  3. Click the Copy button on any card to copy the Markdown snippet to your clipboard.
  4. Use these snippets directly in GitHub, Notion, VS Code, Obsidian, or any Markdown editor.

Frequently Asked Questions

  • What is Markdown?

    Markdown is a lightweight markup language created by John Gruber in 2004. It lets you write formatted text using plain text symbols — for example, surrounding text with ** makes it bold. Markdown files are converted to HTML by renderers used in GitHub, blog platforms, documentation tools, and note apps.

  • Is Markdown the same everywhere?

    The base syntax is largely consistent, but different platforms support different extensions. GitHub Flavored Markdown (GFM) adds task lists, strikethrough, and tables. Obsidian supports wikilinks. Some platforms use CommonMark as their standard. The cheatsheet focuses on the most widely supported features.

  • How do I add a line break in Markdown?

    End a line with two spaces and then press Enter to create a soft line break. For a paragraph break, leave a blank line between two lines. In many renderers, a single newline with no trailing spaces is treated as a space, not a break.

  • Can I use HTML inside Markdown?

    Most Markdown renderers allow raw HTML inline. For example, you can use <br> for a line break, <u>text</u> for underline, or <details> for collapsible sections. However, support varies — some security-focused renderers strip HTML entirely.

What Is Markdown?

Markdown is a plain-text formatting syntax that converts to HTML. Created by John Gruber in 2004, it was designed to be readable as-is — the raw text should look like formatted text even without rendering. Today it is used everywhere: GitHub READMEs, technical documentation, blogging platforms, note-taking apps like Obsidian and Notion, and chat tools like Slack and Discord.

The core idea is simple: use ordinary characters to indicate formatting. A # before a line makes it a heading. Surrounding text with ** makes it bold. Indenting a line with four spaces turns it into a code block. These conventions are intuitive enough that most developers internalize them without formal study.

How a Markdown Cheatsheet Helps

Even experienced writers occasionally forget the exact syntax for a table alignment, a nested list, or a fenced code block with language highlighting. A cheatsheet serves as a fast lookup — you see the raw syntax and the rendered output side by side, so there is no guessing about what the output will look like.

This cheatsheet covers:

  • Headings — six levels from h1 to h4
  • Text formatting — bold, italic, strikethrough, inline code, hyperlinks
  • Lists — ordered, unordered, nested, and task lists
  • Links and images — inline links, titled links, images
  • Blockquotes — single and nested
  • Code blocks — fenced with optional language for syntax highlighting
  • Tables — with column alignment options
  • Horizontal rules — as visual dividers

Markdown Flavors

The base Markdown spec is intentionally minimal. Various tools have extended it:

CommonMark is a standardized specification that resolves ambiguities in the original spec. GitHub, GitLab, Discourse, and many other platforms follow CommonMark or something close to it.

GitHub Flavored Markdown (GFM) adds task lists (- [x]), strikethrough (~~text~~), tables, and autolinks. Most code platforms support GFM or a superset of it.

MDX extends Markdown with JSX, allowing React components to be embedded inline. Used in documentation sites built with Next.js, Astro, and similar tools.

Obsidian Markdown adds wikilinks ([[page name]]), callouts, and graph-related extensions. Useful for personal knowledge management.

For everyday technical writing — READMEs, documentation, blog posts, notes — standard CommonMark plus GFM extensions covers virtually everything you need.

Tips for Writing Good Markdown

Be consistent with list markers. Pick - or * for unordered lists and stick to it. Mixing them in the same document is valid but harder to read in raw form.

Use blank lines between block elements. A blank line before and after headings, code blocks, and blockquotes ensures correct rendering across different parsers.

Prefer fenced code blocks over indented. Fenced blocks (triple backticks) allow you to specify the language for syntax highlighting and are visually clearer in source.

Avoid deeply nested lists. Three or more levels of nesting is hard to read in both raw and rendered form. Consider restructuring as sections with headings instead.

Use descriptive link text. [Click here](url) is worse than [Markdown specification](url) for both readability and accessibility.