Skip to content

How to Create Markdown Files#

This documentation provides a basic tutorial on creating and formatting Markdown (.md) files. Markdown is a lightweight markup language with plain-text formatting syntax that can be converted to HTML. It's widely used for README files, documentation, and more.

Table of Contents:

Getting Started#

To create a Markdown file, you just need a text editor. Save the file with the extension .md or .markdown.

Example

1
2
3
# My Project Documentation

Welcome to my project! This file is written in Markdown.

My Project Documentation

Welcome to my project! This file is written in Markdown.

Headers#

Headers are created by adding one or more # symbols before your header text. The number of # symbols corresponds to the header level.

Example

1
2
3
4
5
6
# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6

Header 1

Header 2

Header 3

Header 4

Header 5

Header 6

Paragraphs and Line Breaks#

Paragraphs are just one or more lines of consecutive text followed by one or more blank lines.

To create a line break, end a line with two or more spaces, then hit Return.

Example

1
2
3
4
This is a paragraph. It has two sentences.

This is another paragraph.  
This line is separated by a line break.

This is a paragraph. It has two sentences.

This is another paragraph.
This line is separated by a line break.

Emphasis#

You can italicize text by wrapping words in a single asterisk (*) or underscore (_). Bold text requires double asterisks (**) or underscores (__).

Example

1
2
3
*This text is italicized*, and so is _this text_.

**This text is bold**, and so is __this text__.

This text is italicized, and so is this text.

This text is bold, and so is this text.

Lists#

You can create ordered and unordered lists.

Example

Unordered:

- Item 1
- Item 2
    - Subitem 2.1
    - Subitem 2.2

---
Ordered:

1. First item
2. Second item

Unordered:

  • Item 1
  • Item 2
    • Subitem 2.1
    • Subitem 2.2

Ordered:

  1. First item
  2. Second item

To create a link, enclose the link text in brackets ([]) and then follow it immediately with the URL in parentheses (()).

Example

This is [an example](http://example.com) link.

This is an example link.

Images#

Images are similar to links, but they include a leading exclamation point (!), followed by the alt text in brackets, and the path or URL to the image in parentheses.

Example

![Picture of a titmouse](gabriel-miklos-Zepatsha9BA-unsplash.jpg)

Picture of a titmouse

Code#

For inline code, wrap the text in backticks (`). For code blocks, use three backticks or indent with four spaces.

Example

This is an inline `code` example.

This is an inline code example.

Tables#

Tables are created using a combination of pipes (|) and dashes (-). The header row is separated from the body by a line of dashes.

Example

1
2
3
4
| Header 1 | Header 2 |
|----------|----------|
| Row 1    | Data     |
| Row 2    | Data     |
Header 1 Header 2
Row 1 Data
Row 2 Data

Blockquotes#

Blockquotes are created by prefixing lines with the > character.

Example

> This is a blockquote.

This is a blockquote.

Horizontal Rules#

Horizontal rules are created by placing three or more hyphens (---), asterisks (***), or underscores (___) on a line by themselves.

Example

1
2
3
4
The line below is an instance of horizontal rules.

---
The rest of the text.

The line below is an instance of horizontal rules.


The rest of the text.

Congratulations, you now know the basics of Markdown! This guide covers the fundamental elements, but there's much more you can do with Markdown. Feel free to explore and experiment.