Markdown Guide: Syntax, Examples, and Cheat Sheet (2026)
Markdown is a lightweight markup language that uses plain-text formatting syntax to create structured documents. Created by John Gruber in 2004, Markdown converts simple characters like hash symbols, asterisks, and dashes into HTML headings, bold text, and lists. It is the most widely used documentation format in software development, adopted by GitHub, GitLab, Reddit, and over 2,199 companies worldwide.
Quick Answer
- 1. Headings: # H1, ## H2, ### H3. Bold: **text**. Italic: *text*. Link: [text](url).
- 2. Voted most admired documentation format for 3 consecutive years in the Stack Overflow Developer Survey (2023-2025).
- 3. Used by 2,199+ verified companies across all industries. 89% of technical docs include code blocks with syntax highlighting.
- 4. Adopted by GitHub, GitLab, Reddit, Stack Overflow, Discord, Notion, Obsidian, and most developer tools.
Convert Markdown to HTML instantly
Paste your Markdown and see the rendered HTML output in real time. Copy the HTML for use anywhere.
Markdown to HTML Converter - FreeHeadings
Headings are created by placing one to six hash symbols (#) at the beginning of a line, followed by a space. The number of hash symbols determines the heading level:
| Markdown | HTML Output | Usage |
|---|---|---|
| # Heading 1 | <h1> | Page title (use once per page) |
| ## Heading 2 | <h2> | Major sections |
| ### Heading 3 | <h3> | Subsections |
| #### Heading 4 | <h4> | Sub-subsections |
| ##### Heading 5 | <h5> | Rarely used |
| ###### Heading 6 | <h6> | Rarely used |
Always leave a blank line before and after headings for best compatibility across Markdown processors. Heading levels should be sequential; do not skip from H2 to H4 without an H3 in between.
Text Formatting
Markdown provides simple syntax for common text formatting:
| Format | Markdown Syntax | Result |
|---|---|---|
| Bold | **bold text** | bold text |
| Italic | *italic text* | italic text |
| Bold + Italic | ***bold italic*** | bold italic |
| Strikethrough | ~~deleted text~~ | |
| Inline code | `code` | code |
You can also use underscores (_) for bold (__text__) and italic (_text_), but asterisks are more commonly used and have fewer edge cases with words containing underscores.
Links and Images
Inline Links
The syntax for links is [link text](URL). For example, [Google](https://google.com) renders as a clickable link with "Google" as the visible text. You can add a title attribute with [link text](URL "title text").
Reference Links
For documents with many links, reference-style links keep the text readable. Define the URL elsewhere in the document using [label]: URL, then reference it with [link text][label]. This separates content from URLs, making long documents easier to maintain.
Images
Image syntax is identical to links but with an exclamation mark prefix: . The alt text is important for accessibility and SEO. For images that need specific sizing, you may need to use raw HTML within your Markdown.
Lists
Unordered Lists
Create unordered (bullet) lists using a dash (-), asterisk (*), or plus sign (+) followed by a space. Nest items by indenting with 2 or 4 spaces:
- First item
- Second item
- Nested item
- Another nested item
- Third item
Ordered Lists
Create ordered (numbered) lists using a number followed by a period and a space. Interestingly, the actual numbers you use do not matter; Markdown will render them sequentially. However, it is best practice to number them correctly for readability in the source text.
Task Lists (GitHub Flavored Markdown)
Task lists add checkboxes to list items. Use - [ ] for unchecked and - [x] for checked items. This is a GitHub Flavored Markdown extension and is not available in all Markdown processors. Task lists are commonly used in GitHub issues and pull requests for tracking progress.
Code Blocks
According to developer surveys, 89 percent of technical documentation includes code blocks with syntax highlighting, making this one of Markdown's most important features.
Inline Code
Wrap inline code with single backticks: `variable_name` renders as variable_name. Use this for short code references within a sentence.
Fenced Code Blocks
For multi-line code, use triple backticks (```) before and after the code. Add a language identifier after the opening backticks for syntax highlighting:
```javascript
function greet(name) {
return `Hello, ${name}!`;
}
```
Most Markdown renderers support syntax highlighting for hundreds of languages including JavaScript, Python, TypeScript, Go, Rust, SQL, and many more.
Tables
Tables use pipes (|) to separate columns and dashes (-) to create the header row separator. Alignment is controlled with colons:
- Left-aligned (default): :--- or ---
- Center-aligned: :---:
- Right-aligned: ---:
Tables are a GitHub Flavored Markdown extension. In standard Markdown (CommonMark), tables are not natively supported. Most modern Markdown processors and platforms support GFM tables.
Blockquotes
Blockquotes use the greater-than symbol (>) at the beginning of each line. They are commonly used for quoting external sources, highlighting important notes, or providing callouts:
> This is a blockquote. It can span multiple lines by starting each line with >.
Nested blockquotes use multiple greater-than symbols (>>). Many documentation platforms extend blockquotes with admonition syntax for notes, warnings, and tips.
Horizontal Rules
Create a horizontal line (thematic break) with three or more dashes (---), asterisks (***), or underscores (___) on their own line. These are useful for separating major sections within a document.
Advanced Markdown Features
Footnotes
Some Markdown processors support footnotes using [^1] in the text and [^1]: Footnote text at the bottom. This is common in academic and long-form writing but is not part of CommonMark or GFM.
Definition Lists
Definition lists use the format Term\n: Definition. Supported by PHP Markdown Extra and some other processors but not by CommonMark or GFM.
Math Notation
Many platforms support LaTeX math notation within Markdown using dollar signs: $E = mc^2$ for inline math and $$....$$ for block math. GitHub, GitLab, Obsidian, and Jupyter Notebooks all support this.
CommonMark vs. GitHub Flavored Markdown
CommonMark is the standardized specification of Markdown that resolves ambiguities in Gruber's original description. GitHub Flavored Markdown (GFM) is a superset of CommonMark that adds tables, task lists, strikethrough, autolinks, and disallowed raw HTML tags. Most platforms implement GFM or a close variant. When writing Markdown, targeting GFM syntax ensures maximum compatibility across platforms.
The Bottom Line
Markdown is the most widely used documentation format in the world, voted most admired by developers for three consecutive years. Its simple syntax (headings with #, bold with **, links with [text](url)) makes it fast to write and easy to read as plain text. Whether you are writing README files, documentation, blog posts, or notes, Markdown's portability and simplicity make it the ideal choice. Over 2,199 companies use it across every industry.
Convert your Markdown to HTML instantly with our free Markdown to HTML converter.
Frequently Asked Questions
What is Markdown and who created it?
Markdown is a lightweight markup language created by John Gruber and Aaron Swartz in 2004. Its primary design goal was to be readable as plain text while also being convertible to structurally valid HTML. Unlike HTML, which uses angle brackets and verbose tag names, Markdown uses simple punctuation characters like hash symbols, asterisks, and dashes to format text. Markdown has since become the most widely used documentation format in the software industry, adopted by GitHub, GitLab, Reddit, Stack Overflow, Discord, and over 2,199 verified companies worldwide.
What is the difference between Markdown and HTML?
Markdown is designed for readability and speed of writing, while HTML is designed for precise structural control. Markdown converts to HTML, so anything written in Markdown becomes HTML under the hood. Key differences: Markdown is easier to read and write as plain text, has a gentler learning curve, and is faster for content creation. HTML offers more control over layout, supports more elements (forms, iframes, custom attributes), and is required for complex web pages. For documentation, articles, and README files, Markdown is almost always the better choice. For web applications and complex layouts, HTML is necessary. Most Markdown processors also allow you to embed raw HTML within Markdown documents for elements that Markdown does not support natively.
What is GitHub Flavored Markdown (GFM)?
GitHub Flavored Markdown (GFM) is an extension of CommonMark Markdown used across GitHub for issues, pull requests, comments, and README files. GFM adds several features not in standard Markdown: task lists (checkboxes with [ ] and [x]), tables (using pipe characters), strikethrough text (using double tildes), autolinked URLs, and syntax-highlighted fenced code blocks (using triple backticks with a language identifier). GFM is the most widely encountered Markdown variant in the software development world. Most other platforms (GitLab, Discourse, Obsidian) support GFM syntax or a close variant.
Can I use Markdown for non-technical writing?
Absolutely. While Markdown was created for web publishing, it has been adopted far beyond software development. Writers use Markdown in tools like Obsidian, Notion, Bear, and Ulysses for note-taking and long-form writing. Academic researchers use Markdown with Pandoc to write papers that can be converted to PDF, Word, or LaTeX. Business teams use Markdown in Confluence, Slack, and Teams for documentation. Email newsletters built in platforms like Buttondown and ConvertKit support Markdown. The main advantages for non-technical users are: it is future-proof (plain text files never become unreadable), it is portable (works across any platform), and it separates content from presentation.
What tools support Markdown?
Markdown is supported by a vast ecosystem of tools. For editing: VS Code, Obsidian, Typora, iA Writer, Bear, StackEdit, and HackMD. For documentation: GitHub, GitLab, Confluence, Notion, and ReadTheDocs. For communication: Slack, Discord, Reddit, Stack Overflow, and Microsoft Teams. For static site generators: Jekyll, Hugo, Gatsby, Next.js, and Astro all render Markdown files as web pages. For conversion: Pandoc converts Markdown to virtually any format (PDF, Word, LaTeX, epub). According to the 2025 Stack Overflow Developer Survey, Markdown was voted the most admired documentation format for the third consecutive year.
Convert Markdown to HTML
Paste your Markdown and get clean, semantic HTML output. Preview the rendered result in real time.
Markdown to HTML Converter - Free