Markdown Formatting Guide Headings Lists Tables a
The easiest Markdown mistake is treating it like plain text with a single rule set. Markdown is a small language with many dialects — and those differences change what you can do, how things render, and whether your tables or footnotes work. According to John Gruber, Markdown was built to be "as easy-to-read and easy-to-write as is feasible." Use that simplicity to your advantage by learning the reliable bits, the platform gaps, and the common traps people hit.
How do I create headings in Markdown?
Use two simple styles: ATX (hashes) and Setext (underlines). Practice one style across a document and use headings to show structure, not decoration.
- ATX (hash) style
- Use 1–6 hashes for H1–H6.
- Example:
# H1 ## H2 ### H3
- Setext (underline) style
- Use equals signs for H1 and hyphens for H2.
- Example:
Title ===== Subtitle --------
According to Daring Fireball, "Markdown supports two styles of headers, Setext and atx." Use Setext only for top-level headings when you want a cleaner visual source file. Use ATX for nested levels or when you need H3–H6.
Practical tips
- Keep a single H1 per document when possible (it's the page title).
- Use headings to create a logical outline — think of them as a table of contents ladder.
- Put a blank line before and after a heading for predictable parsing.
- Avoid underusing heading levels (skip H2 → H4) — readers and tools expect ordered structure.
Custom IDs for headings (when you need direct links)
- Many renderers auto-generate heading IDs (e.g., GitHub). For explicit IDs:
- MultiMarkdown / Pandoc style:
## Report summary {#summary} - HTML inline (supported everywhere):
<h2 id="summary">Report summary</h2>
- MultiMarkdown / Pandoc style:
- Use explicit IDs when you want stable links or when building a manual table of contents.
How do I make lists: ordered, unordered, nested, and task lists?
Lists are one of Markdown's most used parts. Keep markers consistent and mind indentation.
Unordered lists
- Use
-,*, or+(pick one and stick to it). - Example:
- Apple - Banana - Cherry
Ordered lists
- Use numbers with a period. The numbers you write don't always have to match the rendered numbers, but pick one style for clarity.
- Example:
1. First 2. Second 3. Third
Nested lists
- Indent by two or four spaces to nest. Keep indentation consistent.
- Example:
- Item A - Subitem A.1 - Subitem A.2 - Item B
Task lists (checklists)
- These are supported by GitHub Flavored Markdown and others. To create a task list, add dashes and brackets with a space:
- [ ]for undone,- [x]for done. - Example:
- [ ] Run tests - [x] Build release - This follows guidance from the Markdown Guide: "To create a task list, add dashes ( - ) and brackets with a space ( [ ] ) in front of task list items."
Common list mistakes and fixes
- Forgetting a space after the marker:
-Itemwon't render; use- Item. - Mixing tabs and spaces: inconsistent nesting happens across renderers. Use spaces.
- Breaking a list with an extra blank line when you meant to continue it. If you need a paragraph inside a list item, indent the paragraph.
How do I build tables in Markdown?
Tables are handy but not part of original Markdown; many flavors add them. You create a header row, separate it with hyphens, and add rows.
Basic table syntax (GFM / Markdown Guide style)
| Name | Type | Notes |
|--------|---------|----------------|
| id | integer | primary key |
| name | string | required |
- Use three or more hyphens
---for each header column separator. This is how you create the header row in most Markdown guides. - Align columns with colons:
:---left align:---:center align---:right align
- Example:
| Left | Center | Right | |:-----|:------:|------:| | a | b | c |
Tables you can and can't do
- You can do simple grids, alignment, and inline code.
- You can't do native column spans or row spans in standard Markdown. Use HTML tables if you need complex layout.
Table comparing Markdown flavors and table support
| Feature | GitHub Flavored Markdown (GFM) | CommonMark | MultiMarkdown / Pandoc | R Markdown |
|---|---|---|---|---|
| Basic tables | Yes | Optional / via extensions | Yes | Yes (with Pandoc) |
| Column alignment | Yes | Extension | Yes | Yes |
| Row/col spans | No (use HTML) | No | Limited (Pandoc allows HTML) | Use HTML or LaTeX |
| Pipes inside cells | Escape or use code spans | Varies | Better handling | Better handling |
| Fenced code + language in tables | Not standard | Varies | Supported via Pandoc | Supported |
Use tables for small datasets and quick specs. For large tables, consider CSV or a spreadsheet — they render better and are easier to edit.
How do I format text: bold, italics, strikethrough, and escape characters?
Markdown keeps text formatting easy. Use simple markers and escape special characters when needed.
Basic emphasis
- Italic:
*italic*or_italic_ - Bold:
**bold**or__bold__ - Combined:
**_bold italic_**
Strikethrough
- Use
~~strikethrough~~(supported in GFM and many renderers).
Inline code and code blocks
- Inline code: surround with backticks:
`inline()` - Fenced code blocks: use triple backticks and optional language for syntax highlighting:
```python def add(a, b): return a + b - Use fenced blocks for multi-line code; they render the same across most flavors.
Escape characters
- If you want literal asterisks, underscores, or backticks, prefix them with a backslash:
\*literal asterisk\*.
Paragraphs and line breaks
- A paragraph is one or more consecutive lines separated by a blank line. This is how Daring Fireball explains paragraphs in Markdown.
- For a hard line break, end a line with two spaces or use a
<br>tag (renderer dependent).
Practical style tips
- Use inline code for short commands or variable names.
- Use fenced code blocks for full examples — include the language for highlighting.
- Avoid mixing emphasis styles in the same phrase; pick
*or_consistently.
How do I embed links and images?
Links
- Inline link:
[Bank docs](https://example.com/docs) - Reference-style link (good for repeated or long URLs):
[docs][1] [1]: https://example.com/docs "Optional title" - Autolinks:
<https://example.com>will often render as a link.
Images
- Use
!before the link-like syntax and include alt text: - Add a title if you want a hover tooltip:

Accessibility reminder
- Always provide alt text. It helps screen readers and is required in many accessibility guidelines.
How do I write blockquotes and horizontal rules?
Blockquotes
- Start a line with
>for quotes. You can nest blockquotes with additional>markers.> This is a quoted note. > > > Nested quote. - Use blockquotes for cited text, callouts, or short notes. Don't use them for long layout blocks; they can be hard to edit.
Horizontal rules
- Create a horizontal line with three or more hyphens, asterisks, or underscores on a line by themselves:
--- - Use horizontal rules to separate sections or break up long content.
Blockquotes are best for quoted source text and short callouts; they're not a general-purpose layout tool.
What about footnotes, definition lists, and other extensions?
Footnotes
- Not part of original Markdown, but supported by Pandoc, MultiMarkdown, and some other renderers.
- Syntax (Pandoc/MultiMarkdown):
Footnote example.[^1] [^1]: This is the footnote text. - Check your platform: GitHub's markdown does not support footnotes natively in all contexts.
Definition lists
- Supported by some flavors (MultiMarkdown, Pandoc). Example:
Term 1 : Definition for term 1 Term 2 : Definition for term 2 - Use definition lists when you need term → definition pairs (like API param docs).
Markdown extensions and flavors
- Common flavors:
- CommonMark: a spec aiming to standardize Markdown.
- GitHub Flavored Markdown (GFM): adds tables, task lists, autolinks, and more.
- MultiMarkdown / Pandoc: adds footnotes, definition lists, citations, and more output formats.
- R Markdown: integrates Markdown with R code chunks and knitr for reports.
- Choose the flavor that matches your tooling. If you need footnotes or citation support, prefer Pandoc/MultiMarkdown. If you're writing READMEs and issues, use GFM.
What are the common mistakes people make with Markdown?
These errors are frequent and easy to fix. I see them in README files, docs sites, and PR descriptions.
-
Mixing dialects without checking the renderer
- Problem: You write footnotes for GitHub but GitHub doesn't render them.
- Fix: Test in the platform or use a compatibility table.
-
Relying on HTML for structure
- Problem: Many people drop HTML into Markdown for control. It works, but HTML is harder to edit and can break in some renderers.
- Fix: Use Markdown features first; fall back to HTML only when necessary.
-
Bad table formatting
- Problem: Complex tables or pipes inside cells break layout.
- Fix: Keep tables simple, escape pipes (
\|), or use HTML for complex needs.
-
Inconsistent list markers and indentation
- Problem: Renderers differ when you mix
-and*or use tabs. - Fix: Pick one marker, use spaces, and stick to two-space indent for lists.
- Problem: Renderers differ when you mix
-
Not supplying alt text for images
- Problem: Accessibility and compliance gaps.
- Fix: Always add descriptive alt text.
-
Relying on visual spacing rather than blank lines
- Problem: A line break in the source doesn't always produce a line break in the output.
- Fix: Insert blank lines to separate paragraphs or use two trailing spaces for line breaks.
-
Using raw URLs as link text
- Problem: Unclear link context and worse readability.
- Fix: Use descriptive link text:
[API docs](/api).
-
Ignoring code block languages
- Problem: No syntax highlighting makes code harder to scan.
- Fix: Add the language hint after the triple backticks: ```js
What are the best practices for readability and consistency in Markdown?
These rules will make your docs easier to edit, read, and maintain.
Structural practices
- Use a clear heading hierarchy. H1 → H2 → H3, don’t skip levels often.
- Keep H1 as the document title; use H2 for major sections.
- Use short headings that describe what a section answers.
Formatting habits
- Use fenced code blocks with a language tag for all samples.
- Keep line length reasonable (wrap at ~80–100 chars) for source readability and diffs.
- Use reference-style links for repeated URLs to avoid clutter.
- Always include alt text for images.
Team and repo practices
- Pick a Markdown flavor for the project and document it in CONTRIBUTING.md.
- Use a linter (markdownlint, Vale) to enforce style and catch issues.
- Prefer plain Markdown features over HTML to keep content portable.
Naming, front matter, and metadata
- For docs sites, use consistent file naming (e.g.,
01-intro.md) to control order. - If your renderer uses front matter (YAML/JSON), keep keys consistent and documented.
Content design
- Use tables for structured data, not for layout.
- Break long sections into smaller subsections and use headings.
- Use task lists for team checklists and status.
How does Markdown change across platforms like GitHub, R Markdown, and Jupyter?
Markdown behaves differently based on renderer and extensions. Know the differences before you commit.
GitHub (GFM)
- Adds tables, task lists, autolinks, and emoji shortcodes.
- Good for READMEs, issues, and PRs.
- No native footnotes (as of many past states — check current docs).
R Markdown
- Integrates Markdown with R code chunks and output formats like HTML, PDF, and Word.
- Uses knitr and Pandoc under the hood. You can embed R code, plots, and parameterized reports.
Jupyter Notebooks
- Uses a Markdown renderer inside notebook cells.
- Supports inline math with LaTeX ($...$) and fenced code blocks.
- Markdown here is meant for rich notes next to code.
Static site generators (Hugo, Jekyll)
- Often use Markdown plus front matter and template engines.
- May add shortcodes, custom taxonomy tags, or content transforms.
Common rule: write the Markdown to match the target. If you need portability, stick to CommonMark features and avoid platform-specific extensions.
Quick cheat sheet: essential syntax (copyable)
| Purpose | Syntax (source) | Example result |
|---|---|---|
| H1 | # Title | H1 Title |
| H2 | ## Section | H2 Section |
| Italic | *italic* | italic |
| Bold | **bold** | bold |
| Strikethrough | ~~old~~ | |
| Inline code | `x = 1` | x = 1 |
| Code block | js\nconsole.log(1)\n``` | Syntax-highlighted block |
| Unordered list | - item | • item |
| Ordered list | 1. item | 1. item |
| Task list | - [ ] task | ☐ task |
| Table | ` | a |
| Link | [text](url) | text |
| Image |  | image with alt |
| Blockquote | > quote | quoted text |
| HR | --- | horizontal rule |
When should I use Markdown vs. other formats?
Use Markdown when:
- You need quick, readable docs or notes.
- The target is GitHub, a docs site, or a notebook.
- You want plain text that supports version control easily.
Use other formats when:
- You need complex layout (use HTML/CSS or Word).
- You need advanced table features (use CSV/Excel or HTML tables).
- You need a typeset PDF with precise layout (LaTeX might be better).
Example: writing a small product spec in Markdown
Below is a short spec showing headings, lists, table, and code blocks together.
# Payment API spec
## Overview
This endpoint charges a card.
## Request
- Method: `POST`
- URL: `/v1/charge`
## Body parameters
| name | type | required |
|------|------:|:-------:|
| amount | integer | yes |
| currency | string | yes |
## Example
```bash
curl -X POST https://api.example.com/v1/charge \
-d '{"amount":1000,"currency":"usd"}'
Tasks
- Add rate limit headers
- Validate currency codes
This combines the core features you’ll use in product docs.
## Tools and linters to help you ship better Markdown
Use tools to keep quality consistent across teams.
- markdownlint — rules for style and consistency.
- Remark / rehype — parsing and transforms for pipelines.
- Pandoc — convert Markdown to many formats (PDF, DOCX, LaTeX).
- Prettier — format Markdown consistently in codebases.
- Docs-as-code frameworks (Docusaurus, MkDocs) — build sites from Markdown.
## Final rules to remember
- Write for readers first: readable source files mean better edits and fewer merge conflicts.
- Stick to a flavor and document it.
- Test your Markdown in the final platform.
- When in doubt, prefer the plain Markdown that renders everywhere.
> Markdown's power is its limits: a small, consistent syntax that keeps writing fast and readable. Use those limits intentionally.
References and sources
- John Gruber — creator of Markdown; original design goals are about readability and ease of writing.
- Markdown Guide — source for task list and table guidance.
- GitHub Flavored Markdown documentation — for GFM-specific features like task lists and tables.
- CommonMark / Pandoc docs — for spec and extension differences.
If you want, I can:
- Create a one-page Markdown style guide for your team (with rules, lint config, and examples).
- Convert a sample HTML doc into portable Markdown that works for GitHub and Pandoc.
## Frequently Asked Questions
**Q: What is the easiest mistake to make when using Markdown?**
A: The easiest mistake is treating Markdown like plain text with a single rule set, ignoring its various dialects and how they affect rendering.
**Q: How do I create headings in Markdown?**
A: You can create headings using two styles: ATX (hashes) and Setext (underlines), with ATX being preferred for nested levels.
**Q: What are the common mistakes people make with Markdown?**
A: Common mistakes include mixing dialects, relying on HTML for structure, inconsistent list markers, and not supplying alt text for images.
**Q: How do I make lists in Markdown?**
A: You can create unordered lists using `-`, `*`, or `+`, and ordered lists using numbers followed by a period, ensuring consistent markers and indentation.
**Q: How do I format text in Markdown?**
A: Text formatting in Markdown is simple; use `*` for italics, `**` for bold, and `~~` for strikethrough, along with backticks for inline code.
**Q: How do I build tables in Markdown?**
A: To build tables, create a header row separated by hyphens, and align columns using colons for left, center, or right alignment.
**Q: What should I do if my Markdown isn't rendering correctly?**
A: Check for common issues like mixing dialects, inconsistent markers, or forgetting spaces after list markers, and ensure you're using the correct syntax.
**Q: When should I use Markdown instead of other formats?**
A: Use Markdown for quick, readable documentation or notes, especially when targeting platforms like GitHub, while opting for other formats for complex layouts.
---
## SEO Information
**SEO Title:** Markdown Best Practices for Effective Documentation
**Meta Description:** Learn Markdown best practices to avoid common mistakes and improve your documentation with effective Markdown syntax.
**Focus Keyword:** Markdown best practices
**Secondary Keywords:** Markdown syntax, Markdown tips, Markdown mistakes
**URL Slug:** markdown-best-practices
Ready to convert your documents?
Try our free Markdown to Word converter →