Markdown Syntax Cheat Sheet

Markdown syntax reference — headings, formatting, links, images, code blocks, tables, and extended syntax for GitHub, Obsidian, and modern Markdown editors.

Last Updated: July 15, 2025

Basic Formatting

ElementSyntax
Heading 1-6# H1 ## H2 ### H3
Bold**bold** or __bold__
Italic*italic* or _italic_
Strikethrough~~strikethrough~~
Inline Code`code`
Link[text](url)
Image![alt](url)

Lists

TypeSyntax
Unordered- Item or * Item
Ordered1. First 2. Second
Task List- [ ] Todo - [x] Done
NestedIndent 2-4 spaces for sub-items

Code Blocks

```python
Fenced code block with language
```javascript
JavaScript syntax highlighting
```bash
Terminal commands
```mermaid
Diagrams (GitHub, Obsidian)

Tables

ElementSyntax
Header row| Col 1 | Col 2 |
Separator|-------|-------|
Alignment|:---|:---:|---:| (left, center, right)
Pro Tip: Use reference-style links for readability in long documents: define [ref]: url at the bottom, then use [text][ref] in the body. Your raw Markdown stays clean and skimmable.
← Back to Data Science & ML | Browse all categories | View all cheat sheets