What is Markdown? — Lightweight Markup Language Explained
Definition
Markdown is a lightweight markup language created by John Gruber in 2004 that allows you to write formatted text using plain-text syntax that is easy to read and write. Markdown is converted to HTML for display in browsers, making it ideal for documentation, README files, blog posts, and content management. It is the standard format for GitHub READMEs, Stack Overflow posts, Jupyter notebooks, and many documentation tools.
How It Works
Markdown uses simple punctuation-based syntax: # for headings (# H1, ## H2), * or _ for bold (**bold**) and italic (*italic*), - or * for unordered lists, 1. for ordered lists, > for blockquotes, backticks for inline code, triple backticks for fenced code blocks with optional language syntax highlighting, and [text](url) for links. GitHub Flavored Markdown (GFM) adds tables (pipes | create columns), task lists (- [ ]), strikethrough (~~text~~), and autolinks. Markdown parsers convert this syntax to HTML which browsers render.
Common Use Cases
- ▸Writing README files for GitHub repositories
- ▸Creating documentation with tools like MkDocs, Docusaurus, and GitBook
- ▸Composing blog posts in static site generators like Jekyll, Hugo, and Astro
- ▸Writing Stack Overflow answers, GitHub issues, and PR descriptions
- ▸Creating Jupyter notebook prose cells alongside code
Example
# Heading 1
## Heading 2
**Bold** and *italic* text.
- Item one
- Item two
- Nested item
```javascript
console.log("Hello World");
```
[Link text](https://example.com)
| Col A | Col B |
|-------|-------|
| Cell | Cell |Related Tools
Live Markdown editor with side-by-side HTML preview.
Convert Markdown text to clean HTML markup.
Convert HTML markup to clean Markdown syntax.
Normalize and clean up Markdown text for consistent formatting.
Build Markdown tables from a grid of editable cells.
FAQ
- What is the difference between CommonMark, GFM, and original Markdown?
- The original Markdown specification by John Gruber was informal and had many edge cases. CommonMark is a formal, unambiguous specification that standardizes the parsing rules. GitHub Flavored Markdown (GFM) is a CommonMark superset that adds tables, task lists, strikethrough, and autolinks.
- Can Markdown include raw HTML?
- Most Markdown parsers allow raw HTML tags to be included in Markdown documents — the HTML is passed through to the output. However, some parsers sanitize HTML for security (preventing XSS). Whether HTML is allowed depends on the specific parser and its security configuration.
- How do I add syntax highlighting to code blocks?
- In fenced code blocks, add the language name after the opening triple backticks: ```javascript, ```python, ```bash. The Markdown renderer then applies a syntax highlighter library (like highlight.js or Prism) to colorize the code. The language name is case-insensitive.