Check out Our Exclusive Markdown Cheat Sheet

Analytics Vidhya Last Updated : 25 Apr, 2024
6 min read

Markdown is a lightweight markup language that provides a simple way to format text for various purposes without the need for complex HTML or other formatting languages. It’s widely used in documentation, blogs, and other writing platforms due to its simplicity and ease of use. In this Markdown cheat sheet, we’ll cover various formatting options and how to use them effectively to enhance your writing.

Markdown Cheat Sheet

What is Markdown?

Markdown is a simple way to write text that you can easily turn into fancy web pages or documents. Instead of using complicated codes like HTML, you just use symbols like asterisks (*) or hashtags (#) to format your text. It’s really handy for writing stuff online, making README files for projects, or just taking notes. It’s like writing with shortcuts that make your text look nice without a lot of effort.

Markdown Files

Markdown is a lightweight markup language that uses plain text formatting to create richly formatted documents. These files typically have a .md or .markdown extension. They are commonly used for creating documentation, writing blog posts, and formatting text for web pages.

How to Open a Markdown File Offline?

To open a markdown file offline, you can use a text editor or a dedicated markdown editor. Here are the steps to open a markdown file offline:

  • Locate the markdown file on your computer.
  • Right-click on the file and select “Open With.”
  • Choose a text editor a markdown editor from the list of available programs.
  • The markdown file will open in the selected editor, allowing you to view and edit its contents.

Online Markdown Editors

Online markdown editors are web-based tools that allow you to write and preview markdown files directly in your web browser. These editors often provide real-time previews, syntax highlighting, and other helpful features for working with markdown.

Advantages of Markdown Files

  • Easy to learn and use: Markdown has a simple syntax that is easy to understand and write. It doesn’t require complex formatting codes like HTML or CSS.
  • Platform-independent: Markdown files can be opened and viewed on any device or operating system using a compatible text editor or markdown viewer.
  • Lightweight: Markdown files are plain text files, making them small and quick to load. They don’t contain heavy formatting or styling information.
  • Version control friendly: Markdown files work well with version control systems like Git. Changes made to markdown files can be easily tracked, compared, and merged.
  • Portable: Markdown files can be easily converted to other formats like HTML, PDF, or Word using various tools and converters. This portability allows you to share your content across different platforms and applications.
  • Widely supported: Many text editors, content management systems (CMS), and publishing platforms support Markdown. It has become a popular choice for writing content on the web.

Lets have a look at the Markdown cheat sheet!

Headers

They are essential for organizing and structuring your content. Markdown allows you to create different levels of headings using “#” symbols. The number of “#” symbols indicates the heading level.

Headers

Emphasis in Markdown

It is used to highlight specific parts of your text. Markdown offers three options for emphasis: bold, italic, and strikethrough.

To make text bold, wrap it with double asterisks ** or double underscores __.

For making the text italic, enclose it with single asterisks * or single underscores _.

To use strikethrough, surround the text with a double tilde ~~.

Example:

Emphasis

Lists in Markdown

They are used to organize information in unordered or ordered formats.

Unordered Lists

To create an unordered list, use hyphens -, asterisks *, or plus signs + followed by a space.

Example:

Lists

Ordered Lists

To create an ordered list, use numbers followed by a period and a space.

Example:

Numbered List

Hyperlinks are essential for referencing external resources or linking to other pages within your content.

Example:

Links

Images in Markdown

Adding images can make your content more visually appealing. To embed images in Markdown, use an exclamation mark ! at the beginning of the link syntax.

Example:

How to embed images in Markdown | Markdown cheat sheet

Code Blocks in Markdown

Code blocks allow you to display code snippets or entire blocks with proper formatting.

To format code blocks, use triple backticks followed by the programming language name.

Example:

Code Blocks

Horizontal Rules

Horizontal rules help visually separate sections of your content.

To create a horizontal rule, use three or more hyphens, asterisks, or underscores on a new line.

Example:

Horizontal Rules

Blockquotes in Markdown

Blockquotes are used to quote text or sources, making them stand out from the rest of your content.

To create a blockquote, use the greater-than sign (>) before the quoted text.

Example:

Blockquotes

Tables

Tables allow you to present tabular data in a structured manner.

To create a table, use vertical bars (|) to separate columns and hyphens (-) to separate the header row from the content.

Example:

tables in Markdown cheatsheet

Escaping Characters

Sometimes you may need to display special characters that have Markdown formatting significance. To do this, use a backslash \ before the character.

Example:

Escaping Characters

Inline Code

Inline code formatting is useful when mentioning code within your regular text. To format inline code, use single backticks (`) around the code.

Example:

`inline code`

Task Lists

Task lists are useful for creating to-do lists or task tracking. To create a task list, use hyphens (-) or asterisks (*) followed by a space and the brackets [ ] for unchecked items and [x] for checked items.

Example:

Task Lists in Markdown cheatsheet

Markdown automatically detects links that start with http:// or https:// and turns them into clickable hyperlinks.

Example:

Automatic Links in Markdown cheatsheet

Line Breaks

To insert a line break, use two or more spaces at the end of a line.

Example:

Line Breaks in Markdown cheatsheet

HTML in Markdown Cheat Sheet

Markdown allows you to use raw HTML for more complex formatting when needed.

For example, you can use HTML to embed videos or customize the layout:

<iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

However, be cautious when using raw HTML, as it might not work in all Markdown processors.

Conclusion

Markdown is a powerful and versatile tool that can significantly improve the presentation of your content with minimal effort. This Markdown cheat sheet lets you easily format and structure your writing for various purposes. Whether you’re a blogger, developer, or technical writer, Markdown is a valuable addition to your toolkit. 

Frequently Asked Questions

Q1.How do you write commands in Markdown?

To write commands in Markdown, use symbols like ‘#’ for headers or ‘*’ for emphasis.

Q2.What is the syntax for Markdown linking?

Markdown linking syntax uses square brackets for link text and parentheses for the URL: [Link Text](URL).

Q3.Is markdown better than HTML?

Markdown and HTML serve different purposes. Markdown is simpler for basic text formatting, while HTML offers more control and features for web development. The choice depends on your needs.

Analytics Vidhya Content team

Responses From Readers

Clear

We use cookies essential for this site to function well. Please click to help us improve its usefulness with additional cookies. Learn about our use of cookies in our Privacy Policy & Cookies Policy.

Show details