Beginner

Basic Markdown Syntax

Learn all the fundamental Markdown formatting: headings, text styling, links, images, lists, blockquotes, code, and horizontal rules. Each element includes the Markdown source and its rendered output.

Headings

Create headings using the hash symbol (#). The number of hashes determines the heading level (1-6).

Markdown
# Heading 1       <!-- Largest -->
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6    <!-- Smallest -->
Best practice: Always put a space after the hash marks. Always use only one H1 (#) per document. Leave a blank line before and after headings for compatibility.

Paragraphs and Line Breaks

Markdown
This is the first paragraph. It can span
multiple lines in the source file and will
render as a single paragraph.

This is the second paragraph. Separate
paragraphs with a blank line between them.

For a line break without a new paragraph,
end a line with two spaces  
or use a backslash \
at the end of the line.

Text Styling

Markdown
**bold text**            or __bold text__
*italic text*            or _italic text_
***bold and italic***    or ___bold and italic___
~~strikethrough~~        (needs GFM support)

Links

Markdown
# Inline link
[Link text](https://example.com)

# Link with title (hover text)
[Link text](https://example.com "Title text")

# Reference-style link (cleaner for multiple uses)
[Link text][ref-id]

# Define reference elsewhere in the document
[ref-id]: https://example.com "Optional title"

# Autolink (URL displayed as-is)
<https://example.com>

# Email link
<user@example.com>

Images

Markdown
# Inline image
![Alt text](image-url.png)

# Image with title
![Alt text](image-url.png "Image title")

# Reference-style image
![Alt text][img-ref]
[img-ref]: image-url.png "Title"

# Linked image (clickable)
[![Alt text](image.png)](https://example.com)

Lists

Markdown
# Unordered list (use -, *, or +)
- Item one
- Item two
  - Nested item
  - Another nested item
- Item three

# Ordered list
1. First item
2. Second item
   1. Sub-item one
   2. Sub-item two
3. Third item

# Mixed list
1. First ordered item
   - Unordered sub-item
   - Another sub-item
2. Second ordered item

Blockquotes

Markdown
> This is a blockquote. It can span
> multiple lines.

> Blockquotes can contain **formatting**,
> [links](https://example.com), and other
> Markdown elements.

> Nested blockquotes:
>> Use multiple > characters
>> for deeper nesting.

Horizontal Rules

Markdown
# Any of these create a horizontal rule:

---
***
___

Code

Markdown
# Inline code
Use the `print()` function to display output.

# Code block (indented with 4 spaces or 1 tab)
    function hello() {
        console.log("Hello!");
    }

# Fenced code block (preferred method)
```javascript
function hello() {
    console.log("Hello!");
}
```

# Common language identifiers:
# ```python  ```javascript  ```typescript
# ```bash    ```json        ```html
# ```css     ```sql         ```yaml

Escape Characters

Use a backslash (\) to display characters that would otherwise be interpreted as Markdown formatting:

Markdown
\*Not italic\*    # Shows: *Not italic*
\# Not a heading  # Shows: # Not a heading
\[Not a link\]   # Shows: [Not a link]

# Characters you can escape:
\  `  *  _  {}  []  ()  #  +  -  .  !  |

Quick Reference

ElementMarkdown Syntax
Heading# H1 through ###### H6
Bold**text**
Italic*text*
Strikethrough~~text~~
Link[text](url)
Image![alt](url)
Unordered List- item
Ordered List1. item
Blockquote> text
Inline Code`code`
Code Block```lang ... ```
Horizontal Rule---