Skip to content
Go back

Markdown Basics: A Complete Syntax Guide

A comprehensive guide to basic Markdown syntax including headings, text formatting, lists, links, images, blockquotes, tables, task lists, footnotes, and more.

This article covers all the fundamental Markdown syntax you need to write rich, well-structured content. Every feature includes a working example so you can see exactly how it renders.


Headings

Markdown supports six levels of headings. Use # symbols to define the heading level.

Heading Level 1

Heading Level 2

Heading Level 3

Heading Level 4

Heading Level 5
Heading Level 6

Each heading creates an anchor link automatically, making it easy to share and link directly to specific sections. For accessibility, avoid skipping heading levels — go from h2 to h3, not from h2 to h5.


Text Formatting

Markdown provides several inline formatting options:

SyntaxResult
**bold text**bold text
*italic text*italic text
~~strikethrough~~strikethrough
**_bold and italic_**bold and italic
`inline code`inline code
<mark>highlighted</mark>highlighted
<sup>superscript</sup>x2
<sub>subscript</sub>H2O

You can combine these freely:


Lists

Unordered Lists

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

Ordered Lists

Use numbers followed by a period:

  1. First step
  2. Second step
  3. Third step
    1. Sub-step 3a
    2. Sub-step 3b
      1. Sub-sub-step
      2. Another sub-sub-step
    3. Sub-step 3c
  4. Fourth step

Mixed Lists

You can nest ordered lists inside unordered lists and vice versa:

List with Paragraphs

List items can contain multiple paragraphs by indenting:

  1. First item with a long description.

    This is a continuation paragraph under the first item. Notice the blank line and indentation.

  2. Second item.

    Another paragraph here. Lists can contain any block-level content when properly indented.


Visit Astro’s official site to learn more about the framework.

You can also add a title attribute: Astro Documentation.

For cleaner text, use reference-style links:

Read the Astro guide or check the Tailwind docs for styling.

Auto-linked URLs

Simply paste a URL and it becomes clickable: https://github.com

Images

Standard image syntax:

A serene mountain landscape

Image with title text:

Code on a screen

Linked Images

Astro Logo


Blockquotes

Simple Blockquote

Markdown is a lightweight markup language with plain text formatting syntax. It was created by John Gruber in 2004.

Multi-Paragraph Blockquote

The first paragraph of the quote.

The second paragraph of the quote. Use a > on the blank line between paragraphs to keep them in the same blockquote.

Nested Blockquotes

This is the outer blockquote.

This is a nested blockquote. It goes one level deeper.

And this is nested even further — three levels deep!

Back to the first level.

Blockquote with Other Elements

Blockquote with a Heading

  • Item one
  • Item two

The quote can contain bold, italic, and code formatting, as well as lists and other Markdown elements.


Horizontal Rules

You can create horizontal rules with three or more hyphens, asterisks, or underscores:




All three render identically. Use them to visually separate sections of content.


Tables

Simple Table

NameRoleLocation
AliceFrontend DeveloperTokyo
BobBackend DeveloperBerlin
CarolDevOps EngineerNew York

Aligned Table

Use colons to align columns:

Left AlignedCenter AlignedRight Aligned
ContentContentContent
MoreMoreMore
TextTextText

Complex Table

FeatureFree PlanPro PlanEnterprise
Users110Unlimited
Storage1 GB100 GB1 TB
API Calls1,000/mo100,000/moUnlimited
SupportCommunityEmail24/7 Phone
SSO
Custom Domain
AnalyticsBasicAdvancedAdvanced

Table with Formatting

MethodDescriptionExample
GETRetrieve a resourcefetch('/api/users')
POSTCreate a new resourcefetch('/api/users', { method: 'POST' })
PUTUpdate a resourcefetch('/api/users/1', { method: 'PUT' })
DELETERemove a resourcefetch('/api/users/1', { method: 'DELETE' })

Task Lists

Task lists (checkboxes) are great for tracking progress:

Nested Task Lists


Footnotes

Footnotes let you add references without cluttering the text.

Markdown was created by John Gruber1 and Aaron Swartz2 in 2004. It has since become one of the most popular markup languages for writing content on the web3.

The original Markdown specification1 was intentionally minimal. Many extended syntaxes like GitHub Flavored Markdown (GFM)4 have expanded on the original.


Emoji Support

You can use emoji shortcodes in your Markdown:

Emoji in Context

💡 Tip: Use emoji sparingly in technical writing. They work great for status indicators and casual blog posts.

Here’s a quick project status:

TaskStatus
Backend API✔️ Complete
Frontend UI🚧 In Progress
Documentation:book: Drafting
Testing❌ Not Started
Deployment🚀 Ready

Wrapping Up

This article covered the core Markdown syntax you’ll use daily. Markdown’s simplicity is its strength — a few symbols transform plain text into rich, structured documents. For more advanced features like math formulas, code highlighting, and alerts, see the Markdown Extended Features article.

Footnotes

  1. John Gruber is a technology blogger and the creator of the Daring Fireball blog. 2

  2. Aaron Swartz was a programmer, writer, and internet activist who contributed to the Markdown specification.

  3. According to various developer surveys, Markdown is the most commonly used documentation format.

  4. GitHub Flavored Markdown (GFM) adds tables, task lists, strikethrough, and autolinks to the original spec.



Previous Post
Excalidraw Whiteboard: Hand-Drawn Diagrams in Your Blog
Next Post
Markdown Extended: Advanced Syntax Features

评论区

文明评论,共建和谐社区