Back to Blog
Tutorialsmarkdowndocumentationwriting

Markdown Writing Guide: Format Text Like a Developer

The complete Markdown reference. Learn all syntax from basics to GitHub Flavored Markdown, including tables, code blocks, task lists, and best practices.

Loopaloo TeamAugust 20, 202514 min read

Markdown is one of those rare technical inventions that feels, in hindsight, completely inevitable. It is the lingua franca of the modern web's written word — the default syntax behind GitHub READMEs, developer documentation, static blogs, note-taking applications, and countless content management systems. Yet its dominance was never guaranteed. Understanding how Markdown came to be, what principles drive its design, and how to wield its syntax effectively will make you a sharper, more versatile writer in any technical context. You can experiment with everything discussed here in our Markdown Editor, which renders your formatting in real time.

The Origins of Markdown

In 2004, the blogger and technology writer John Gruber, working in collaboration with the programmer Aaron Swartz, released Markdown as both a plain-text formatting syntax and a Perl script that converted that syntax into valid HTML. Gruber had grown frustrated with writing raw HTML for his website, Daring Fireball. HTML was powerful but visually noisy — a simple paragraph peppered with angle brackets and closing tags obscured the actual prose. Gruber wanted something that could be read comfortably in its raw form while still producing clean web output when processed.

Aaron Swartz, who was only seventeen at the time, contributed to the parser's design and helped shape the syntax decisions that made Markdown feel natural. Swartz was already deeply immersed in web standards, having co-authored the RSS 1.0 specification, and his instinct for pragmatic simplicity left a lasting imprint on the project. The result was a language whose source files read almost like a plain-text email — a deliberate design choice rooted in the conventions that had evolved organically on Usenet and in early mailing lists.

Why Markdown Won

Markdown was not the first lightweight markup language. Wiki syntax, reStructuredText, Textile, and BBCode all predated it or arrived around the same time. Yet Markdown eclipsed them because it prioritized a single, deceptively powerful idea: the raw text should be pleasant to read without any rendering at all. Where other formats introduced idiosyncratic tokens — double curly braces, square bracket prefixes, custom tag conventions — Markdown leaned on punctuation patterns that people already used informally. Asterisks for emphasis, hashes for headings, and hyphens for list items all felt familiar rather than learned.

Equally important was Markdown's permissive relationship with HTML. Rather than trying to replace HTML entirely, Gruber declared that any valid HTML could be embedded directly in a Markdown document. This escape hatch meant authors were never trapped: if Markdown's syntax didn't cover a particular need, raw HTML filled the gap. That pragmatic flexibility attracted early adopters who might otherwise have dismissed the format as too limited.

The final catalyst was GitHub. When GitHub adopted Markdown for READMEs, issues, pull requests, and wikis, millions of developers encountered the syntax daily. Markdown became muscle memory for an entire generation of software engineers, and from there it spread into tools like Slack, Discord, Notion, Obsidian, Reddit, and Stack Overflow.

CommonMark and the Push for Standardization

Gruber's original specification was intentionally informal — more of a description of his Perl script's behavior than a rigorous grammar. This ambiguity bred incompatibilities. Different parsers handled edge cases differently: nested lists, lazy continuation lines, and blank lines within blockquotes could all produce divergent output depending on which tool you used.

In 2014, a group of developers led by John MacFarlane launched the CommonMark project, aiming to produce an unambiguous, test-suite–backed specification for Markdown. CommonMark preserved Gruber's core syntax but resolved hundreds of ambiguous corner cases with explicit rules. Today, most serious Markdown parsers — including those powering GitHub, GitLab, Reddit, and many static site generators — either implement CommonMark directly or use it as their baseline.

GitHub Flavored Markdown

GitHub Flavored Markdown, commonly abbreviated GFM, is a superset of CommonMark maintained by GitHub. It adds several extensions that have become so widely adopted they feel like standard Markdown to many writers. These include tables, task lists, strikethrough text using double tildes, fenced code blocks with syntax highlighting, autolinked URLs, and footnotes. GFM also introduced alert callout blocks — admonitions prefixed with tokens like [!NOTE], [!TIP], and [!WARNING] inside blockquotes — which have become a popular convention for documentation.

Because GFM is the variant most developers encounter first, many of the syntax features described below are labeled where they extend beyond core Markdown or CommonMark.

The Philosophy of Readable Raw Text

The single most important design principle in Markdown is that the source document should be comfortable to read as-is. A Markdown file is not a compiled artifact that only makes sense after processing; it is a human-readable document that happens also to have a structured interpretation. This philosophy has profound implications for how you should write. Favor clarity in the raw text over cleverness in the rendered output. Use blank lines generously to separate logical sections. Choose link reference definitions over sprawling inline URLs when a paragraph contains many hyperlinks. The goal is always dual readability: the rendered page looks polished, and the source file looks clean.

Headings and Semantic Structure

Headings in Markdown are created by prefixing a line with one to six hash characters, where a single hash produces a top-level heading and six hashes produce the smallest subheading. An alternative underline syntax exists for the first two levels — using a line of equals signs beneath text for a level-one heading and a line of hyphens for level two — but the ATX-style hash syntax is far more common in practice.

# Document Title
## Major Section
### Subsection
#### Minor Subsection

What matters more than the syntax itself is the semantic meaning headings convey. A well-structured Markdown document uses exactly one level-one heading as its title, level-two headings for major sections, and level-three and below for progressively narrower subsections. This hierarchy isn't merely cosmetic — screen readers, search engines, and documentation generators all rely on heading levels to understand a document's structure. Skipping levels, such as jumping from an H2 directly to an H4, breaks that contract and produces a confusing outline.

Emphasis and Strong Emphasis

Markdown distinguishes between emphasis, rendered as italics, and strong emphasis, rendered as bold. Single asterisks or underscores wrap emphasized text, while doubled asterisks or underscores produce strong emphasis. Tripling them combines both effects.

*emphasis* and **strong emphasis** and ***both combined***

The convention in most style guides is to prefer asterisks over underscores, because underscores can produce unexpected behavior in the middle of words — some_variable_name might be partially italicized by a naive parser. Strikethrough, a GFM extension, wraps text in double tildes: ~~deleted text~~. These inline formatting tools are deliberately minimal. Markdown does not natively support underline, colored text, or font changes, and that is by design. The format pushes you toward semantic markup — indicating that something is important — rather than presentational markup that dictates how it should look.

Links and Images

Links are one of Markdown's most elegant constructions. The inline form places the visible text in square brackets immediately followed by the URL in parentheses, with an optional title in quotes.

[Markdown Editor](/tools/markdown-editor)
[Example](https://example.com "An example site")

When a document contains many links, the reference-style variant keeps the prose readable by moving URLs to the bottom of the document or section, much like footnotes in printed text.

See the [installation guide][install] and the [API reference][api] for details.

[install]: /docs/install
[api]: /docs/api "API Documentation"

Images use identical syntax preceded by an exclamation mark. The text inside the square brackets serves as alt text, which is critical for accessibility and should always describe the image's content rather than being left empty.

![A flowchart showing the build pipeline](pipeline.png)

Standard Markdown provides no mechanism for controlling image dimensions, but most processors accept inline HTML for that purpose, and some extended syntaxes offer custom attributes.

Blockquotes

Blockquotes prefix each line with a right-angle bracket, mirroring the convention used in email replies for decades. They can contain any other Markdown element — paragraphs, headings, lists, even code blocks — and can be nested by stacking angle brackets.

> The overriding design goal for Markdown's formatting syntax is to make it
> as readable as possible. The idea is that a Markdown-formatted document
> should be publishable as-is, as plain text.
>
> — John Gruber

Blockquotes are ideal for attributing quotations, calling out important notes, and offsetting referenced material from your own prose. In GFM, alert syntax builds on blockquotes to create styled admonition boxes for notes, tips, and warnings.

Inline Code and Code Blocks

Wrapping a word or short phrase in single backticks renders it as inline code, displayed in a monospaced font and visually distinct from surrounding text. This is the correct way to refer to function names, variable names, file paths, and terminal commands within a sentence. If the text you need to mark as code itself contains a backtick, you can wrap it in double backticks with spaces as delimiters.

For multi-line code, fenced code blocks are the standard approach. Three backticks open the block, an optional language identifier enables syntax highlighting, and three more backticks close it.

\`\`\`python
def greet(name: str) -> str:
    return f"Hello, {name}!"
\`\`\`

The language identifier is not merely decorative. Syntax highlighting dramatically improves code readability, and many documentation systems use the identifier to enable features like copy buttons, line numbers, and executable code cells. Common identifiers include javascript, python, bash, typescript, json, html, css, go, rust, and sql.

Lists: When Bullets Are Appropriate

Markdown supports both unordered lists, using hyphens, asterisks, or plus signs, and ordered lists, using numbers followed by periods. Lists can be nested by indenting child items with two to four spaces, and ordered and unordered types can be freely mixed.

1. Clone the repository
2. Install dependencies
   - Run \`npm install\` for Node packages
   - Run \`pip install -r requirements.txt\` for Python
3. Start the development server

Lists are one of the most overused elements in technical writing. A wall of bullet points is not inherently clearer than a well-constructed paragraph — often it is less clear, because bullets strip away the connective reasoning that links ideas together. Reserve bulleted lists for genuinely parallel, scannable items: feature inventories, step-by-step procedures, option comparisons, and checklists. When the relationship between ideas is sequential, causal, or argumentative, prose serves the reader better.

Tables

Tables in Markdown use pipes and hyphens to define columns and rows. A header row separated from the body by a line of dashes is required. Column alignment is controlled by placing colons in the separator line: a colon on the left for left-alignment, on the right for right-alignment, or on both sides for centering.

| Format   | Extension | Use Case              |
|:---------|:---------:|----------------------:|
| Markdown | .md       | Documentation & prose |
| HTML     | .html     | Web pages             |
| LaTeX    | .tex      | Academic papers       |

Tables are a GFM extension, though they are now supported by virtually every Markdown processor. They work best for small, structured data sets. For anything beyond a handful of columns and rows, a proper data table rendered from a CSV file or a database query will be far easier to maintain. Our Text Formatter can help you clean and align tabular data before dropping it into Markdown.

Task Lists

Task lists extend unordered list syntax with a bracketed checkbox. An x inside the brackets marks a task as complete, while an empty pair of brackets indicates an incomplete item.

- [x] Write first draft
- [x] Review with editor
- [ ] Publish to production

On GitHub, these checkboxes are interactive — reviewers can tick them off directly in an issue or pull request without editing the Markdown source. Task lists have become a lightweight project management tool in their own right, frequently used to track progress on multi-part issues, release checklists, and onboarding procedures.

Footnotes

Footnotes allow you to attach supplementary information to a point in your text without disrupting the flow of the main argument. The syntax places a caret-bracketed reference marker in the body text and a matching definition elsewhere in the document.

Markdown was created in 2004.[^1]

[^1]: Gruber published the initial version on his blog, Daring Fireball, alongside a Perl conversion script.

Footnotes are a GFM extension and are now supported by most modern Markdown processors. They are particularly valuable in long-form writing — blog posts, research notes, and technical specifications — where digressions and citations would otherwise clutter the narrative.

Writing Documentation with Markdown

Markdown has become the default language of software documentation. Projects from small open-source libraries to massive enterprise platforms maintain their docs as Markdown files checked into version control alongside the source code. This practice, sometimes called "docs as code," brings the same review, branching, and deployment workflows that govern software to the documentation that describes it.

Effective documentation in Markdown follows a few key principles. Each page should have a single, clear purpose expressed by its title. Headings should form a logical outline that a reader can scan to quickly find what they need. Code examples should be fenced with a language identifier so they receive syntax highlighting and can be automatically tested by documentation tooling. Internal links should use relative paths so the documentation remains portable across hosting environments. And every document should be written for the reader who will arrive at that page from a search engine, not just for someone reading the docs front to back.

Markdown in Static Site Generators

The explosion of static site generators over the past decade has elevated Markdown from a convenience format to a publishing standard. Tools like Hugo, Jekyll, Gatsby, Astro, Next.js, and Eleventy all treat Markdown files as first-class content sources. A typical workflow involves writing articles or pages as Markdown files with YAML or TOML front matter — metadata blocks at the top of the file that specify the title, date, tags, and other properties — which the generator then combines with templates to produce a complete website.

This architecture is powerful because it separates content from presentation completely. A writer working in Markdown never needs to touch CSS or JavaScript. The same Markdown file can be rendered by different themes, exported to PDF, or consumed by an API. Front matter provides the structured metadata that drives navigation, categorization, and SEO, while the Markdown body provides the prose. For blogs, knowledge bases, and documentation sites, this combination of simplicity and flexibility has proven remarkably difficult to beat.

Mastering the Medium

Markdown's greatest strength is that it disappears. Unlike a word processor cluttered with toolbars, or an HTML document bristling with tags, a Markdown file looks like what it means. That transparency is a gift to writers, but it demands discipline. Choose your heading hierarchy with care. Write real paragraphs instead of defaulting to bullet points. Use code fences with language identifiers. Supply meaningful alt text for every image. Structure your links for readability in both the source and the rendered output.

The format rewards writers who think in terms of structure and semantics rather than visual decoration. Master those habits, and Markdown becomes not just a syntax to memorize but a framework for thinking clearly about how information should be organized and presented. Open the Markdown Editor and start writing — the best way to internalize these principles is through practice.

Related Articles

Try Our Free Tools

200+ browser-based tools for developers and creators. No uploads, complete privacy.

Explore All Tools