What is Markdown?

Markdown is a lightweight markup language that lets you write formatted documents using simple plain text syntax. It was created by John Gruber in 2004 with the goal of making documents easy to read even in their raw source form.

Why Use Markdown?

  • Simple and Easy to Learn: Intuitive syntax that can be picked up in minutes
  • Widely Supported: Tools like GitHub, GitLab, Notion, HackMD, and VS Code all support it
  • Focus on Content: No need to click formatting buttons, keep your hands on the keyboard
  • Version Control Friendly: Plain text format, perfect for use with Git
  • Multi-Format Output: Easily convert to HTML, PDF, slides, and more

Common Uses for Markdown

  • Writing technical documentation and READMEs
  • Blog posts
  • Notes and knowledge management
  • GitHub Issues and Pull Request descriptions
  • Email and message formatting

Headings

Use the # symbol to create headings. The number of # symbols determines the heading level (1-6):

Loading...

Tip: There must be a space between # and the heading text. It is generally recommended to use only one H1 heading per document and use H2 and below for the rest.


Paragraphs & Line Breaks

Paragraphs are separated by a blank line:

Loading...

If you only need a line break without starting a new paragraph, add two spaces at the end of the line before pressing Enter, or use the <br> tag:

Loading...

Text Emphasis

Bold

Loading...

This is bold text

Italic

Loading...

This is italic text

Bold & Italic

Loading...

This is bold and italic

Strikethrough

Loading...

This is deleted text

Highlight

Some platforms support using == to highlight text:

Loading...

Lists

Unordered List

Use -, *, or + to create unordered lists:

Loading...
  • Item 1
    • Sub-item 1.1
    • Sub-item 1.2
  • Item 2
    • Sub-item 2.1
      • Sub-sub-item 2.1.1

Ordered List

Use numbers followed by . to create ordered lists:

Loading...
  1. First item
  2. Second item
    1. Sub-item of second 1
    2. Sub-item of second 2
  3. Third item

Tip: The numbers in ordered lists do not need to be sequential as Markdown will auto-number them. However, it is recommended to write them in order for better source readability.


Blockquote

Use > to create blockquotes:

Loading...

This is a blockquote.

This is a nested blockquote.

Blockquotes can also contain other Markdown elements:

Note: You can use bold, italic, code, and other formatting inside blockquotes.

  • Lists work too
  • Very useful

Code

Inline Code

Wrap code with backticks `:

Loading...

Use console.log() to print messages.

Code Blocks

Use triple backticks ``` with a language identifier to create code blocks:

Loading...
Loading...

Common language identifiers: javascript, python, bash, html, css, json, yaml, sql, go, rust, etc.

Diff

Use the diff language identifier to display code changes:

Loading...
Loading...

Loading...

Link text

Useful when the same link is used multiple times in a document:

Loading...

Paste URLs directly or use angle brackets:

Loading...

Images

Loading...

Alt text

You can also use reference-style links:

Loading...

Tip: If you need to control image size, use the HTML <img> tag:

Loading...

Tables

Use | and - to create tables:

Loading...
Header 1Header 2Header 3
Cell 1Cell 2Cell 3
Cell 4Cell 5Cell 6

Table Alignment

Use : to control alignment:

Loading...
Left AlignedCenter AlignedRight Aligned
LeftCenterRight
DataDataData

Task Lists

Use - [ ] and - [x] to create task lists:

Loading...
  • Completed item
  • This one is done too
  • Incomplete item
  • To-do item

Horizontal Rule

Use three or more -, *, or _ to create a horizontal rule:

Loading...

Escaping Special Characters

To display Markdown special characters, use a backslash \ to escape them:

Loading...

Escapable characters: \, `, *, _, {}, [], (), #, +, -, ., !, |


Footnotes

Footnotes let you add supplementary information without disrupting the reading flow:

Loading...

This is a paragraph with a footnote.1


Collapsible Sections

Use the HTML <details> tag to create collapsible content blocks:

Loading...
<details> <summary>Click to expand</summary>

This is the collapsed content.

</details>

Math Equations

Some platforms (like GitHub and HackMD) support LaTeX math equations:

Inline Equations

Loading...

Inline equation: $E = mc^2$

Block Equations

Loading...

$$ \sum_{i=1}^{n} x_i = x_1 + x_2 + \cdots + x_n $$


Custom HTML

You can embed HTML tags directly in Markdown for formatting effects that Markdown syntax cannot achieve:

Loading...

GitHub Flavored Markdown

GitHub supports some additional Markdown syntax:

Alerts

Loading...

Emoji

Loading...

Mentions & References

Loading...

Best Practices

  • Be Consistent: Once you pick a style (e.g., using - or * for list markers), stick with it throughout the document
  • Use Blank Lines: Add blank lines between paragraphs and around headings to make the source more readable
  • Structure with Headings: Use H2-H4 headings appropriately to give your document a clear hierarchy
  • Alt Text: Always add alt text to images for better accessibility
  • Preview: Use preview features to verify the formatting after writing
  • Use Code Blocks: Specify the language for syntax highlighting to improve readability

Footnotes

  1. This is the footnote content.