Markdown Guide: Complete Reference for Markdown Formatting
Master Markdown syntax and tools. Learn basic and advanced formatting, GitHub Flavored Markdown, tables, code blocks, and converting between Markdown and HTML.
What is Markdown?
Markdown is a lightweight markup language created by John Gruber in 2004. It uses plain text formatting syntax that converts to HTML, making it easy to write formatted documents without using a complex editor.
Why Use Markdown?
Markdown is widely used for documentation, README files, blog posts, forums, and note-taking because of its simplicity and readability.
Basic Markdown Syntax
Learn the fundamental Markdown syntax for headings, emphasis, lists, links, images, and more.
Headings
Headings are created using hash symbols (#). The number of hashes determines the heading level.
Emphasis (Bold and Italic)
Emphasize text using asterisks or underscores for italic and bold formatting.
Lists
Create ordered and unordered lists using numbers or symbols like asterisks, plus, or minus.
Links and Images
Add hyperlinks and images using square brackets for text/alt and parentheses for URLs.
Blockquotes
Create blockquotes using the greater-than symbol (>) at the start of lines.
Code
Display inline code using backticks and code blocks using triple backticks or indentation.
Horizontal Rules
Create horizontal lines using three or more hyphens, asterisks, or underscores.
Advanced Markdown Features
GitHub Flavored Markdown (GFM) and other extensions add tables, syntax highlighting, task lists, and more.
Tables
Create tables using pipes (|) and hyphens to separate headers and content.
Footnotes
Add footnotes to provide additional information without cluttering the main text.
Definition Lists
Create definition lists for terms and their descriptions (supported in some Markdown flavors).
Math and Formulas
Many Markdown processors support LaTeX-style math notation for mathematical formulas.
Mermaid Diagrams
GitHub and some Markdown processors support Mermaid for creating diagrams and flowcharts.
GitHub Flavored Markdown (GFM)
GitHub Flavored Markdown extends standard Markdown with features specific to GitHub.
GFM-Specific Features
GitHub adds features like task lists, tables, emoji, mentions, and issue references.
Markdown to HTML Conversion
Convert Markdown to HTML using various parsers and libraries across different programming languages.
JavaScript Markdown Parsers
Popular JavaScript libraries for parsing Markdown include marked, markdown-it, and remark.
Python Markdown Parsers
Parse Markdown in Python using libraries like markdown, mistune, or markdown2.
PHP Markdown Parsers
Parse Markdown in PHP using libraries like Parsedown or CommonMark.
HTML to Markdown Conversion
Convert HTML back to Markdown format for editing or processing.
HTML to Markdown Converters
Libraries and tools for converting HTML to Markdown across different platforms.
Markdown Best Practices
Follow best practices for writing maintainable and readable Markdown documents.
Writing Guidelines
Tips for creating clean, consistent, and accessible Markdown documents.
Common Mistakes
Avoid these common Markdown formatting mistakes.