Introduction to Markdown
Discover the simple formatting language that powers GitHub, documentation, and the modern web.
What You'll Learn
- What Markdown is and why it was created
- Where Markdown is used in the real world
- Basic syntax: headings, paragraphs, and emphasis
- How Markdown compares to HTML
What Is Markdown?
Markdown is a lightweight markup language that lets you add formatting to plain text. Created by John Gruber in 2004, its goal was simple: make formatted text that's easy to read even in its raw form.
๐ Real-World Analogy: Think of Markdown like shorthand for a typesetter. Instead of writing complex HTML tags, you use simple symbols like # for headings and ** for bold. A Markdown processor then converts your shorthand into beautifully formatted HTML.
Why Developers Love Markdown
- Readable โ Raw Markdown is human-readable, unlike HTML
- Fast โ No mouse clicking; format as you type
- Portable โ Plain text works everywhere
- Universal โ GitHub, Slack, Discord, Notion all support it
- Version-friendly โ Git can track changes easily
Markdown vs HTML
| Markdown | HTML | Result |
|---|---|---|
| # Hello | <h1>Hello</h1> | Hello |
| **bold** | <strong>bold</strong> | bold |
| *italic* | <em>italic</em> | italic |
| [link](url) | <a href="url">link</a> | link |
What is Markdown?
Explore what Markdown is and where it's used.
// Introduction to Markdown โ rendered as text
console.log("=== What is Markdown? ===");
console.log();
console.log("Markdown is a lightweight markup language created by");
console.log("John Gruber in 2004. It lets you format plain text");
console.log("using simple symbols that are easy to read AND write.");
console.log();
console.log("=== Markdown vs HTML ===");
console.log("Markdown: # Hello World");
console.log("HTML: <h1>Hello World</h1>");
console.log();
console.log("Markdown: **bol
...Basic Syntax Overview
Headings
Use # symbols for headings. The number of # symbols determines the level (1โ6):
# Heading 1 โ Page Title ## Heading 2 โ Section ### Heading 3 โ Subsection #### Heading 4 โ Sub-subsection
Text Emphasis
**bold text** โ bold text *italic text* โ italic text ***bold and italic***โ bold and italic ~~strikethrough~~ โ strikethrough `inline code` โ inline code
Blockquotes
> This is a blockquote. > It can span multiple lines. > >> You can nest blockquotes too.
โ ๏ธ Common Mistake
Forgetting the space after #. #Hello won't render as a heading โ you need # Hello with a space. Similarly, **bold** needs no spaces inside the asterisks, but ** bold ** (with spaces) won't work in most parsers.
Basic Syntax
Review all the fundamental Markdown formatting symbols.
// Basic Markdown Syntax Overview
console.log("=== Headings ===");
console.log("# Heading 1 (largest)");
console.log("## Heading 2");
console.log("### Heading 3");
console.log("#### Heading 4");
console.log("##### Heading 5");
console.log("###### Heading 6 (smallest)");
console.log();
console.log("=== Text Formatting ===");
console.log("**bold** โ bold");
console.log("*italic* โ italic");
console.log("***bold italic*** โ bold italic");
console.log("~~strikethrough~~ โ st
...๐ก Pro Tip
Most code editors (VS Code, Sublime Text) have Markdown preview built in. In VS Code, press Ctrl+Shift+V (or Cmd+Shift+V on Mac) to see a live preview of your Markdown file.
๐ Quick Reference
| Element | Syntax |
|---|---|
| Heading | # H1 ## H2 ### H3 |
| Bold | **text** |
| Italic | *text* |
| Blockquote | > text |
| Inline code | `code` |
| Horizontal rule | --- |
๐ Lesson Complete!
You now know what Markdown is, where it's used, and the basic formatting syntax. Next, we'll dive deeper into formatting with headings, emphasis, code, and blockquotes.
Sign up for free to track which lessons you've completed and get learning reminders.