Skip to main content

Markdown Cheat Sheet

Summary

This cheat sheet provides a comprehensive overview of Markdown syntax, covering text formatting, headings, lists, links, images, code blocks, tables, and more. It also highlights advanced features like footnotes, syntax highlighting, and custom HTML integration for enhanced content styling.

Introduction #

Markdown is a lightweight markup language used to format text on the web. It provides an easy-to-read and easy-to-write syntax for creating well-structured content. The cheat sheet covers essential Markdown features, including text formatting, headings, lists, links, images, and more, helping you create clean and professional-looking documents with minimal effort.

Text Formatting #

Headings #

Lists #

Unordered List #

- Item 1
- Item 2
  - Sub-item 1
  - Sub-item 2

Will be renderd as:

Alternatively:

* Item 1
* Item 2
  * Sub-item 1
  * Sub-item 2

Will be renderd as:

Ordered List #

1. First
2. Second
   1. Sub-item 1
   2. Sub-item 2

Will be rendered as:

  1. First
  2. Second
    1. Sub-item 1
    2. Sub-item 2

Also:

1. First
1. Second
   1. Sub-item 1
   1. Sub-item 2

Will be rendered as:

  1. First
  2. Second
    1. Sub-item 1
    2. Sub-item 2

Tasks Lists #

- [x] Task 1
  - [x] Subtask 1.1
  - [ ] Subtask 1.2
- [ ] Task 2

Will be rendered as:

<https://example.com>  
<email@example.com>

Will be rendered as:

https://example.com
email@example.com

[Link to example.com](https://example.com/)

Will be renderd as:

Link to example.com

[Link to example.com](https://example.com/ "Title")

Will be renderd as:

Link to example.com

Line Breaks #

Two Spaces Method #

Add two spaces (denoted as ␣␣) at the end of a line, then press Enter. The characters denote a line break. This inserts a line break (<br>).

First line.␣␣↵
Second line.

Will be rendered as:

First line.
Second line.

Blank Line Method #

Insert a blank line between two lines of text (new paragraph).

First line.↵
↵
Second line.

Will be rendered as:

First line.

Second line.

Images #

With alt-Attribute #

![ditig.com Logo](https://www.ditig.com/assets/graphics/logo_black.svg)

Will be rendered as:

ditig.com Logo

With alt and title-Attributes #

![ditig.com Logo](https://www.ditig.com/assets/graphics/logo_black.svg "University of Hard Knocks (UHK) · Department of Information Technology Instructions & Guides (DITIG).")

Will be rendered as:

ditig.com Logo

Linked Image #

[![ditig.com Logo](https://www.ditig.com/assets/graphics/logo_black.svg "University of Hard Knocks (UHK) · Department of Information Technology Instructions & Guides (DITIG).")](https://www.ditig.com/)

Will be rendered as:

ditig.com Logo

Blockquotes #

Put blank lines before and after blockquotes.

Single Paragraph #


> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices, odio non dapibus egestas, enim mauris euismod dolor, nec vehicula neque metus quis elit.

Will be rendered as:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices, odio non dapibus egestas, enim mauris euismod dolor, nec vehicula neque metus quis elit.

Multiple Paragraphs #


> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices, odio non dapibus egestas, enim mauris euismod dolor, nec vehicula neque metus quis elit.
> 
> Vivamus laoreet tortor quis lacus porta, a pretium lorem convallis.

Will be rendered as:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices, odio non dapibus egestas, enim mauris euismod dolor, nec vehicula neque metus quis elit.

Vivamus laoreet tortor quis lacus porta, a pretium lorem convallis.

Nested Blockquote #


> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices, odio non dapibus egestas, enim mauris euismod dolor, nec vehicula neque metus quis elit.
>> Nulla vehicula id sapien ut feugiat. In elit eros, sodales a elit vitae, posuere posuere turpis. Curabitur tristique euismod tempus.
>
> Vivamus laoreet tortor quis lacus porta, a pretium lorem convallis.

Will be rendered as:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices, odio non dapibus egestas, enim mauris euismod dolor, nec vehicula neque metus quis elit.

Nulla vehicula id sapien ut feugiat. In elit eros, sodales a elit vitae, posuere posuere turpis. Curabitur tristique euismod tempus.

Vivamus laoreet tortor quis lacus porta, a pretium lorem convallis.

Structured Blockquotes #


> #### Lorem Ipsum Dolor
> Lorem ipsum dolor sit amet, _consectetur_ adipiscing elit. Nam ultrices, odio non dapibus egestas, enim mauris euismod dolor, nec vehicula neque metus quis elit.
>> Nulla vehicula id sapien ut feugiat. In elit eros, sodales a elit vitae, posuere posuere turpis. **Curabitur** tristique euismod tempus.
>
> Vivamus laoreet tortor quis lacus porta, a pretium **lorem convallis**.

Will be rendered as:

Lorem Ipsum Dolor #

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices, odio non dapibus egestas, enim mauris euismod dolor, nec vehicula neque metus quis elit.

Nulla vehicula id sapien ut feugiat. In elit eros, sodales a elit vitae, posuere posuere turpis. Curabitur tristique euismod tempus.

Vivamus laoreet tortor quis lacus porta, a pretium lorem convallis.

Code #

Inline Code #

Use `code()` for inline code.

Will be rendered as:

Use code() for inline code.

Code Block #

```
print("Hello, World!")
```

Will be rendered as:

print("Hello, World!")

Also see: Code blocks in markdown lists

Tables #

| Header 1 | Header 2 |
|---       |---       |
| Row 1    | Data 1   |
| Row 2    | Data 2   |

Will be rendered as:

Header 1Header 2
Row 1Data 1
Row 2Data 2

Horizontal Rule #

---

Will be rendered as:


Also:

***

Will be rendered as:


Escaping #

Use \ to escape special characters.

\*escaped asterisk\*

Will be rendered as:

*escaped asterisk*

Escapable Characters #

CharCharacter name
< >angle brackets
*asterisk
\backslash
`backtick
[ ]brackets
{ }curly braces
.dot
!exclamation mark
-minus sign (hyphen)
( )parentheses
|pipe
+plus sign
#pound sign
_underscore

HTML #

<b>Bold with HTML</b>  
<i>Italic with HTML</i>  
<span style="color: red;">Red Text</span>

Will be rendered as:

Bold with HTML
Italic with HTML
Red Text

Limited Support #

The following features are only supported in some (not all) Markdown processors, e.g. GitHub-flavored Markdown. These features extend Markdown’s basic syntax.

Footnotes #

This is a sentence with a footnote.[^1]

[^1]: This is the footnote text.

Definition Lists #

Term 1
: Definition for term 1

Term 2
: Definition for term 2

Syntax Highlighting #

```javascript
function greet() {
    console.log("Hello, World!");
}

Will be rendered as:

function greet() {
    console.log("Hello, World!");
}

Emojis #

:smile: :rocket: :sparkles:

Will be rendered as:

😄 🚀 ✨

Custom IDs for Headings #

### Heading with ID {#custom-id}

Will be rendered as:

<h3 id="custom-id">Heading with ID</h3>


Further readings #

Sources and recommended, further resources on the topic:

Author

Jonas Jared Jacek • J15k

Jonas Jared Jacek (J15k)

Jonas works as project manager, web designer, and web developer since 2001. On top of that, he is a Linux system administrator with a broad interest in things related to programming, architecture, and design. See: https://www.j15k.com/

License

License: Markdown Cheat Sheet by Jonas Jared Jacek is licensed under CC BY-SA 4.0.

This license requires that reusers give credit to the creator. It allows reusers to distribute, remix, adapt, and build upon the material in any medium or format, for noncommercial purposes only. To give credit, provide a link back to the original source, the author, and the license e.g. like this:

<p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><a property="dct:title" rel="cc:attributionURL" href="https://www.ditig.com/publications/markdown-cheat-sheet">Markdown Cheat Sheet</a> by <a rel="cc:attributionURL dct:creator" property="cc:attributionName" href="https://www.j15k.com/">Jonas Jared Jacek</a> is licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="license noopener noreferrer">CC BY-SA 4.0</a>.</p>

For more information see the DITig legal page.


“There are only two hard things in Computer Science: cache invalidation and naming things.”

Philip Lewis Karlton, American computer scientist and programmerWord of mouth, - IT quotes