Open an .mdSyntaxConvertAgent filesLink library

Reference · Plain text · Agent-readable formats

The .md file,
explained properly

Markdown is twenty-two years old and has quietly become the most important document format in your stack. It is what your README is written in, what your AI assistant writes back to you in, and what agents now read before they touch your codebase. This is the long version: open it, read it, write it, convert it, and understand why it won.

hero.md — source rendered →
## What you are looking at

A .md file is **just text**.
The characters *are* the formatting.

- No binary container
- No proprietary reader
- Readable at 3am in a terminal

> HTML is a publishing format;
> Markdown is a writing format.

What you are looking at

A .md file is just text. The characters are the formatting.

  • No binary container
  • No proprietary reader
  • Readable at 3am in a terminal
HTML is a publishing format; Markdown is a writing format.

01 / DefinitionWhat an .md file actually is

An .md file is a plain text file that uses punctuation as formatting. Open it in Notepad and you see everything there is to see. There is no hidden layer, no XML zip container, no version of the file that only Word can read. A hash makes a heading. Two asterisks make bold. A hyphen makes a bullet.

That is the whole idea, and it is why the format has outlived nearly everything it competed with. Markdown was designed so that the marked-up source is itself readable — a document should be publishable as-is, as plain text, without looking like it has been marked up at all. Every design decision in the syntax follows from that one rule.

Two things share the name. Markdown is the syntax — the conventions for turning punctuation into structure. Markdown is also the original 2004 Perl script that converts that syntax into HTML. Today you almost always mean the first thing, and the converter is whatever your editor, static site generator, or CI pipeline happens to use.

PropertyValue
Extensions.md (dominant), .markdown, and in the wild .mdown, .mkd, .mdx (MDX), .qmd (Quarto), .rmd (R Markdown)
Media typetext/markdown, registered by RFC 7763 in March 2016, with an optional variant parameter to declare the dialect
EncodingUTF-8 text. No magic number, no header, no binary section
Uniform Type Identifiernet.daringfireball.markdown, conforming to public.plain-text
CreatedMarch 2004 by John Gruber, with input from Aaron Swartz. Version 1.0.1 of the Perl converter shipped 17 December 2004 and was the last release
Reference specCommonMark 0.31.2 (28 January 2024) — the closest thing to a normative definition, with 500+ worked examples doubling as conformance tests
LicenceThe original implementation is BSD-style; the syntax itself is not owned by anyone
Careful — .md is an overloaded extension

Markdown is not the only thing that claims .md. The same three characters are used by Sega Mega Drive / Genesis ROM images, GCC machine-description files, Moneydance personal finance data, MuseData music notation, and MDCD archives from the MS-DOS era. If a .md file opens as binary gibberish in a text editor, it is one of those — not broken Markdown. Check the first bytes before you go looking for a Markdown viewer.

Why anyone bothers

The argument for Markdown is not aesthetic. It is operational.

It diffs

Line-based plain text means git diff shows exactly what changed in a sentence. A .docx shows that a zip archive changed. Review, blame, and merge all work.

It survives

No renderer, no problem. A twenty-year-old Markdown file is still fully legible today in any text editor on any operating system. That is not true of most formats from 2004.

It is writable at speed

Hands never leave the keyboard, no formatting toolbar, no cursor hunting. Structure is expressed while you write rather than applied afterwards.

Machines parse it cheaply

Headings, lists and code fences give a document real structure with almost no syntactic overhead — which is exactly why language models, RAG pipelines and coding agents converged on it.

The tradeoff is real and worth stating: Markdown has no page layout, no fonts, no footers, no columns, no change tracking, and no native comments. It is a writing format, not a publishing format. When you need typeset output you convert it — see converting to and from Markdown.

02 / UtilityOpen an .md file right now

If you landed here because something handed you a .md file and your machine had no idea what to do with it — drop it below. Nothing is uploaded; the file is read and rendered locally in your browser.

Markdown viewer · local only

Rendered output appears here.

Runs entirely in your browser — no upload, no account, works offline once the page is loaded. Raw HTML inside the file is displayed as escaped text rather than executed, on purpose.

Three other one-second answers, before the long ones in section 06:

  • Just read it: rename the file to .txt and open it. Markdown was designed to be legible unrendered. Nothing is lost.
  • Read it formatted: drag the file into a browser tab with a Markdown viewer extension installed, or paste it into any online renderer.
  • Read it on GitHub: drop the file into a gist and GitHub renders it in full GitHub Flavored Markdown.

03 / HistoryHow Markdown happened — and how it got standardised twice

Markdown's history has a distinct shape: one designer's tool, then a decade of chaotic forks, then a community specification, then a second wave of standardisation driven by machines rather than people.

WAVE 1 — FOR PEOPLE WAVE 2 — FOR MACHINES 20042004–2014 2014–20192024–2026 InventionFragmentation SpecificationAgent infrastructure One Perl script anda syntax page. Incompatible dialects.Same input, different HTML. CommonMark, RFC 7763,GFM 0.29-gfm. llms.txt, AGENTS.md,Markdown for Agents. Twenty years unstandardised, then standardised twice in twelve — the second time for readers that are not human.
Phases are shown in sequence, not to scale. Dates: Markdown 2004; CommonMark 2014; RFC 7763 March 2016; GFM 0.29-gfm April 2019; llms.txt September 2024; Cloudflare Markdown for Agents February 2026.
  • March 2004John Gruber releases Markdown

    Announced on Daring Fireball as a text-to-HTML tool for web writers, built as a Movable Type plug-in and standalone Perl script. Aaron Swartz contributed to the design. The stated influences are Setext, atx, Textile, reStructuredText, Grutatext and EtText — but the biggest one is the informal conventions of plain-text email.

  • December 2004Version 1.0.1 — and then nothing

    Markdown.pl 1.0.1 ships on 17 December 2004. It is still the last official release. The syntax page and the Perl script are the entire specification, and both leave a great deal ambiguous.

  • 2004–2014The fork decade

    Ambiguity plus popularity produces dialects: PHP Markdown Extra, MultiMarkdown, Pandoc's Markdown, Maruku, kramdown, and eventually GitHub's own. Identical input produces different HTML in different tools. The Babelmark comparison tool exists purely to document the divergence.

  • 2014CommonMark

    John MacFarlane — author of Pandoc — leads a standardisation effort with contributors from GitHub, Stack Overflow, Reddit and Discourse. The result is an unambiguous spec plus reference implementations in C (cmark) and JavaScript, defined by hundreds of input/output test cases rather than prose alone.

  • March 2016IETF registration

    RFC 7763 registers text/markdown as a media type; RFC 7764 documents the design philosophies and variant strategy, and an IANA registry of Markdown variants is created so a document can declare which dialect it is written in.

  • April 2019GitHub Flavored Markdown gets a formal spec

    GFM 0.29-gfm is published as a strict superset of CommonMark, adding exactly five extensions: tables, task lists, strikethrough, extended autolinks and an HTML tag filter. It has not been revised since — while GitHub's actual renderer has kept growing.

  • September 2024llms.txt

    Jeremy Howard of Answer.AI proposes /llms.txt: a Markdown file at the root of a site that gives language models a curated map of what matters, plus the convention of serving a clean .md version of any page at the same URL with .md appended.

  • 2025–2026Markdown becomes agent infrastructure

    AGENTS.md emerges as a cross-vendor instruction file and is adopted by 60,000+ open-source projects before being placed under the Linux Foundation's Agentic AI Foundation. Anthropic ships CLAUDE.md and the SKILL.md format for packaging agent skills. The most important new file formats of the decade are all, structurally, just Markdown. See section 09.

The pattern worth noticing

Markdown was standardised the first time because humans needed consistent rendering across websites. It is being standardised a second time because machines need consistent instructions across tools. Both waves converged on the same answer: keep it plain text, keep the structure shallow, keep it readable to whoever opens it — carbon or silicon.

04 / ReferenceThe complete Markdown syntax reference

Everything below is CommonMark unless marked as an extension. Each block shows the source on the left and what a renderer produces on the right — the split view that Markdown editors have used since the beginning, and the fastest way to learn the format.

At a glance

You wantYou typeWhere it works
Heading# H1###### H6Everywhere
Bold**bold** or __bold__Everywhere
Italic*italic* or _italic_Everywhere
Bold italic***both***Everywhere
Strikethrough~~gone~~GFM extension
Bulleted list- item (also * or +)Everywhere
Numbered list1. itemEverywhere
Checkbox- [ ] todo / - [x] doneGFM extension
Link[text](https://url)Everywhere
Image![alt](path.png)Everywhere
Inline code`code`Everywhere
Code blockthree backticks, optional languageCommonMark
Quote> quotedEverywhere
Callout> [!NOTE]GitHub renderer
Tablepipes and dashesGFM extension
Divider--- on its own lineEverywhere
Hard line breaktwo trailing spaces, or \CommonMark
Escape a character\*not italic\*Everywhere
MetadataYAML front matter between --- linesTool-specific

Headings

One to six hash characters, a space, then the text. The space is not optional in CommonMark — #Heading renders as literal text, which is the single most common beginner mistake. Setext headings, made by underlining with = or -, still work but only reach two levels and are rare in modern documents.

headings — sourcerendered →
# Document title
## A major section
### A subsection
###### The smallest heading

Setext style
===========

Second level
-----------

Document title

A major section

A subsection

The smallest heading

Setext style

Second level

Use exactly one # per document and never skip levels. Most renderers generate anchor IDs from heading text, so ## Set up the CLI becomes #set-up-the-cli — that is how you deep-link into a README.

Emphasis

Asterisks and underscores both work for emphasis, but they are not interchangeable in practice. Underscores do not apply inside words in CommonMark, which protects snake_case_names from being mangled. Asterisks do apply mid-word. Pick asterisks as your house default and the problem disappears.

emphasis — sourcerendered →
Plain, *italic*, **bold**,
***bold italic***, ~~struck out~~.

Underscores work too: _italic_,
__bold__ — but snake_case_stays
intact, which asterisks do not guarantee.

Escape with a backslash: \*literal asterisks\*

Plain, italic, bold, bold italic, struck out.

Underscores work too: italic, bold — but snake_case_stays intact, which asterisks do not guarantee.

Escape with a backslash: *literal asterisks*

Paragraphs and line breaks

A blank line starts a new paragraph. A single newline inside a paragraph is ignored — the lines are joined. This surprises everyone once. To force a break without starting a paragraph, end the line with two spaces or a backslash.

breaks — sourcerendered →
These two lines
become one paragraph.

This line ends with two spaces··
so this one starts below it.

This one uses a backslash\
which does the same job visibly.

These two lines become one paragraph.

This line ends with two spaces
so this one starts below it.

This one uses a backslash
which does the same job visibly.

Lists

Bullets take -, * or +; ordered lists take a number and a dot. The numbers you type are ignored beyond the first — write 1. all the way down and the renderer counts for you, which makes reordering painless. Indent by two spaces (or four, consistently) to nest. Task lists with - [ ] are a GFM extension and are what drives the checkboxes in GitHub issues.

lists — sourcerendered →
- Discovery
- Design
  - Trust architecture
  - Action heat ladder
- Delivery

1. Audit the surface
1. Map the touchpoints
1. Ship the change

- [x] Write the brief
- [ ] Get it signed off
  • Discovery
  • Design
    • Trust architecture
    • Action heat ladder
  • Delivery
  1. Audit the surface
  2. Map the touchpoints
  3. Ship the change
  • Write the brief
  • Get it signed off

Links and images

Four link forms matter. Inline links are the default. Reference links keep long URLs out of the prose and are worth using in documents that link heavily. Autolinks wrap a bare URL in angle brackets. Relative links resolve against the file's location, which is how a README links to docs/CONTRIBUTING.md and still works after the repository is cloned.

links — sourcerendered →
[inline link](https://commonmark.org)
[with a title](https://spec.commonmark.org "The spec")
[reference link][spec]
<https://agents.md>
[a local file](docs/CONTRIBUTING.md)
[jump to a heading](#lists)

![alt text describing the image](diagram.png)

[spec]: https://spec.commonmark.org

Alt text is not optional in a document anyone else will read. It is the only description a screen reader — or a language model ingesting your repo — will ever get of that image.

Code

Backticks for inline code; three backticks for a fenced block. Add a language identifier after the opening fence and every serious renderer will syntax-highlight it. If the code you are showing contains backticks, open the fence with four. Indenting four spaces also produces a code block, but fences are clearer and carry the language hint.

code — sourcerendered →
Run `npm install` first.

```bash
pandoc notes.md -o notes.pdf
```

```json
{ "variant": "GFM" }
```

Run npm install first.

pandoc notes.md -o notes.pdf
{ "variant": "GFM" }

Quotes and callouts

A > prefix quotes a block, and quotes nest. GitHub's alert syntax rides on top of the same mechanism: a blockquote whose first line is [!NOTE], [!TIP], [!IMPORTANT], [!WARNING] or [!CAUTION] renders as a coloured callout. Those five are the complete set, they cannot be nested inside other elements, and outside GitHub's renderer they degrade to an ordinary quote.

quotes — sourcerendered →
> Markdown is intended to be as
> easy-to-read as is feasible.

> [!NOTE]
> Useful context a reader should
> have, even when skimming.

> [!WARNING]
> Something that will bite you.

Markdown is intended to be as easy-to-read as is feasible.

NOTE

Useful context a reader should have, even when skimming.

WARNING

Something that will bite you.

Tables

Tables are a GFM extension, not base Markdown — original 2004 Markdown had none, and told you to write raw HTML instead. Pipes separate cells; the second row sets alignment with colons. The columns do not need to line up in the source, though aligning them makes the file readable, which is rather the point of the format.

tables — sourcerendered →
| File | Audience | Loaded |
| :--- | :---: | ---: |
| README.md | humans | always |
| AGENTS.md | agents | always |
| SKILL.md | agents | on demand |
FileAudienceLoaded
README.mdhumansalways
AGENTS.mdagentsalways
SKILL.mdagentson demand

Dividers, escapes and raw HTML

Three or more hyphens, asterisks or underscores on their own line produce a horizontal rule. A backslash escapes any punctuation character that would otherwise be syntax. And because Markdown was designed as a front end for HTML, raw HTML is legal inside it — though sanitising renderers (GitHub among them) filter dangerous tags, and pure-Markdown pipelines may strip it entirely.

misc — sourcerendered →
Above the line.

---

Below it. Escape syntax with
a backslash: \# not a heading,
2 \* 3 \* 4 is arithmetic.

<details>
<summary>Click to expand</summary>

Hidden until opened.

</details>

Above the line.


Below it. Escape syntax with a backslash: # not a heading, 2 * 3 * 4 is arithmetic.

Click to expand
Hidden until opened.

The <details> trick above is the standard way to fold long sections inside a README. Leave a blank line after the <summary> tag or the Markdown inside will not be processed.

Footnotes and front matter

Footnotes are an extension — supported by GitHub, Pandoc and most static site generators, but not by CommonMark and not inside GitHub wikis. Front matter is not part of any Markdown spec at all: it is a YAML (occasionally TOML or JSON) block fenced by --- at the very top of the file, which the tool reading the file strips off and parses as metadata. Every static site generator, and now every agent skill format, relies on it.

metadata — sourcerendered →
---
title: The .md file, explained
date: 2026-08-09
tags: [markdown, agents, docs]
draft: false
---

The body starts here.[^1]

[^1]: And this is the footnote.
front matter — consumed by the tool, not rendered
title: The .md file, explained
date: 2026-08-09
tags: [markdown, agents, docs]
draft: false

The body starts here.1


1. And this is the footnote.

05 / DialectsFlavours: why the same file looks different in two tools

There is no single Markdown. There is a small core everyone agrees on, and a ring of extensions that vary by renderer. Knowing which ring you are standing in is most of the debugging.

The practical model has three layers. Core CommonMark — headings, emphasis, lists, links, code, quotes — behaves identically everywhere. Common extensions — tables, strikethrough, task lists, footnotes — are supported by most tools but not all, and not always the same way. Platform features — GitHub's alerts, Mermaid diagrams, wiki-links, LaTeX maths — are renderer-specific and degrade to plain text or raw source elsewhere.

FlavourWhat it isAddsYou meet it in
OriginalGruber's 2004 syntax + Perl script, frozen at 1.0.1Nothing since 2004Historical documents, legacy blog engines
CommonMarkThe unambiguous community spec, v0.31.2Fenced code, precise edge-case rulesReddit, Discourse, Stack Overflow, most libraries
GFMStrict superset of CommonMark, spec v0.29-gfmTables, task lists, strikethrough, autolinks, tag filterGitHub, GitLab, and nearly every developer tool
GitHub rendererGFM plus proprietary rendering that is not in the specAlerts, footnotes, Mermaid, GeoJSON, maths, emoji, @mentionsgithub.com only
Pandoc MarkdownThe most feature-complete dialect, aimed at publishingCitations, definition lists, divs and spans, maths, cross-referencesAcademic writing, book pipelines, pandoc
MultiMarkdownEarly academic-leaning extension of the originalMetadata, footnotes, tables, cross-referencesLong-form and print workflows
PHP Markdown ExtraThe first widely used extension setTables, definition lists, footnotes, attribute blocksOlder PHP CMSs, kramdown lineage
MDXMarkdown with JSX — components inside proseImport and render UI components in a documentDocusaurus, Next.js docs, Astro, design systems
MySTMarkdown for scientific and technical publishingDirectives, roles, executable content, Sphinx compatibilityJupyter Book, Python documentation
R Markdown / QuartoLiterate computing — code chunks that executeExecutable blocks, figure and table numbering, multi-format outputData science reporting, .rmd and .qmd files
Obsidian flavourCommonMark plus knowledge-base conventions[[wiki links]], embeds, callouts, block referencesObsidian vaults and the many tools copying them
The portability rule

Write to CommonMark plus GFM tables and you will render correctly essentially everywhere. Every feature beyond that is a deliberate trade: you are buying expressiveness in one renderer and paying for it the day the file moves. If a document has to survive a move — to a package registry, a mirror, a docs build, or a model's context window — keep it boring.

06 / How-toOpening and editing .md files on every platform

Nothing needs installing to read a Markdown file — every operating system already ships a text editor. What people actually want is to read it formatted. Here is the shortest route on each platform.

Windows

  • Read as-is: right-click → Open with → Notepad. Works on every Windows machine ever made.
  • Read formatted, no install: use a browser-based viewer, or paste into a gist.
  • Read formatted, properly: install Visual Studio Code, open the file, press Ctrl+Shift+V for a rendered preview or Ctrl+K then V for a side-by-side one. VS Code ships Markdown preview with no extension required.
  • Open in Word: Word will open a .md file as text. For a properly formatted document, convert it first — see section 07.
  • Set the default: right-click → Open with → Choose another app → tick "always use this app". Windows has no built-in Markdown association, so whatever you choose here is the one that sticks.

macOS

  • Quick Look: select the file in Finder and press space. macOS previews it as plain text; add a Quick Look plugin if you want it rendered.
  • TextEdit opens any .md file directly. So does BBEdit, which has handled Markdown since roughly the beginning.
  • Dedicated writing apps: iA Writer, Typora, Obsidian, Zettlr — all treat .md as their native format rather than an import.
  • Terminal: glow file.md or bat file.md renders Markdown with styling straight in the shell.

iPhone and iPad

iOS has no system-level Markdown viewer, which is why "how to open md on iPhone" is a genuinely common search. Options, cheapest first:

  • Files app: tap the file — iOS shows it as plain text. Perfectly readable, just unformatted.
  • Apple Notes / Pages: paste the text in. Notes converts common Markdown as you type.
  • A Markdown app: Obsidian, iA Writer, Taio, Runestone and others open .md from the Files app and render it. Once installed, iOS offers them in the share sheet.
  • Shortcuts: a two-step shortcut ("Get file → Make rich text from Markdown → Quick Look") gives you a native renderer with no app at all.

Android

  • Most file managers open .md in a text viewer by default. Choose "Open with → Text editor" if prompted.
  • Markor, Obsidian, and other Markdown editors register the .md type and appear in the "open with" list once installed.
  • Google Drive will preview an uploaded .md as text, and Google Docs can import it as a formatted document.

In the browser

  • Browser extensions such as Markdown Viewer render local .md files when you drag them into a tab — you must grant access to local file URLs for this to work.
  • Web editors — StackEdit, Dillinger, HackMD — give you live preview and export without installing anything.
  • The viewer in section 02 of this page does the same thing without sending the file anywhere.

In your editor or IDE

VS Code

Built-in preview, outline view, and a large extension ecosystem: markdownlint for rules, Markdown All in One for tables and shortcuts, Mermaid preview for diagrams.

JetBrains IDEs

Native split preview with diagram and PlantUML support. Markdown files are first-class citizens in the project tree.

Vim / Neovim

markdown-preview.nvim for live browser preview; render-markdown.nvim for in-buffer rendering. Or just read it raw, which is the point.

07 / ConversionConverting Markdown to and from everything else

Markdown is a source format. Sooner or later something wants a PDF, a Word file, a deck, or clean HTML. There is one tool that does nearly all of it, and a set of second-best options for when you cannot install anything.

Pandoc — the universal converter

Pandoc, written by the same John MacFarlane who led CommonMark, converts between dozens of document formats through a common internal representation. It is the correct default answer to almost every "convert md to X" question.

# Markdown → PDF (needs a LaTeX engine, or use --pdf-engine=weasyprint) pandoc notes.md -o notes.pdf # Markdown → Word pandoc notes.md -o notes.docx # Markdown → Word, using your company template for styles pandoc notes.md --reference-doc=house-style.docx -o notes.docx # Markdown → standalone HTML with a table of contents pandoc notes.md -s --toc -o notes.html # Markdown → PowerPoint (each H2 becomes a slide) pandoc deck.md -o deck.pptx # Word → Markdown, extracting images to a folder pandoc report.docx -t gfm --extract-media=./img -o report.md # HTML → Markdown pandoc page.html -f html -t gfm -o page.md # Batch: every .md in a folder → PDF for f in *.md; do pandoc "$f" -o "${f%.md}.pdf"; done

Without installing anything

ConversionFastest no-install routeWatch out for
MD → PDFRender it (VS Code preview, browser viewer, gist) then print to PDFPage breaks and margins are whatever the renderer's CSS says
MD → WordGoogle Docs: File → Open → Upload the .md, then File → Download → .docxCode blocks and tables usually survive; footnotes and maths often do not
MD → Google DocUpload to Drive, right-click → Open with Google Docs. Import and export of Markdown are on by defaultEnable Tools → Preferences → Markdown for paste-as-Markdown behaviour
MD → HTMLnpx marked -i in.md -o out.html, or any web renderer's exportYou get a fragment, not a styled page — add your own CSS
MD → slidesPaste into Marp, Slidev or reveal.js — all read Markdown nativelySlide breaks are convention-based; check the tool's separator
Word → MDGoogle Docs: File → Download → Markdown (.md)Tracked changes and comments are dropped entirely
HTML → MDTurndown (JS) or any browser-based converterNested layout tables and inline styles convert badly — expect cleanup
PDF → MDA document-extraction tool; there is no clean answer, PDFs discard structureReading order, columns and tables are frequently wrong. Always check
Direction matters

Converting from Markdown is lossless in spirit — you are adding presentation to structure. Converting to Markdown is lossy by definition — you are throwing presentation away to recover structure, and anything that was only ever visual formatting will not come back. Decide which format is your source of truth and convert one way, always. Round-tripping a document between Word and Markdown will slowly destroy it.

08 / ToolingEditors, viewers, libraries and linters

A working Markdown setup usually has four parts: something to write in, something to render with, something to enforce consistency, and something to publish. Here is the landscape, grouped by the job you are hiring the tool for.

Writing apps

Browser-based editors and viewers

Parsers and libraries

LibraryLanguageNotes
cmarkCCommonMark reference implementation; cmark-gfm is GitHub's fork with the GFM extensions
markdown-itJavaScriptCommonMark-compliant, plugin-driven, the default choice for custom pipelines
markedJavaScriptFast and tiny; has a CLI, which makes it handy for one-off conversion
remark / unifiedJavaScriptTurns Markdown into a syntax tree you can transform programmatically — the right tool for large-scale content migrations
goldmarkGoCommonMark-compliant and extensible; powers Hugo
Python-Markdown / markdown-it-pyPythonThe two mainstream Python options; the latter is a port of markdown-it and is CommonMark-compliant
pulldown-cmarkRustPull-parser design, very fast, used widely in Rust tooling
TurndownJavaScriptThe other direction: HTML into Markdown

Linting and quality

Publishing from Markdown

09 / The turnMarkdown became the interface between humans and agents

Something changed between 2024 and 2026. Markdown stopped being only a way to write documents for people and became the default way to write instructions for machines that read like documents. Every significant agent-configuration format that has emerged is, structurally, a Markdown file.

The reason is not sentimental. A Markdown file is simultaneously the cheapest format for a model to parse and the only format a human maintainer will reliably keep up to date. JSON and YAML are machine-friendly but nobody writes prose in them. A wiki is human-friendly but nothing can load it deterministically. Markdown sits on the seam: headings give a model structure, prose gives it nuance, and a person can review the diff in a pull request.

Four families of file matter right now, and they are complementary rather than competing. The distinction between them is who reads it and when it loads.

FileRead byLoadedJob
README.mdHumansWhen someone opens the repoOrientation: what this is, how to start, how to contribute
AGENTS.mdCoding agents, cross-vendorEvery sessionOperating instructions: build, test, conventions, boundaries
CLAUDE.mdClaude CodeEvery sessionSame job, Claude's native filename, with scoping and imports
SKILL.mdClaudeOnly when relevantA packaged procedure the agent loads on demand
llms.txtModels reading your websiteAt retrieval timeA curated map of what matters on the site, in Markdown

Underneath all four is the same bet: that the readable artefact and the machine-readable artefact should be the same file. When the instructions an agent follows are a document a person can review in a pull request, you get auditability, versioning and shared understanding for free. When they are a config blob or a vector store, you get none of that. That is an interface design decision that happens to be stored in a repo — and it is where trust in agentic systems is built or lost.

Read next

Each of those formats, why agents converged on plain text at all, what Cloudflare's Markdown for Agents changed in February 2026, and how to build a context layer for a business: Markdown for AI: why .md files became the context layer for agents.

Writing Markdown that a model reads well

Whoever the reader is, the same craft applies — these are habits worth having in any document, not agent-specific tricks.

  • Front-load the answer. A section's first sentence should stand alone when retrieved out of context. Retrieval chunks rarely carry the paragraph above them.
  • Use headings as an index, not decoration. Nested, meaningful headings give a chunker natural boundaries. A 4,000-word document with two headings will be split badly.
  • Keep one idea per section. Mixed-topic sections retrieve poorly and get quoted out of context.
  • Prefer tables for parameters and comparisons. A Markdown table survives extraction; a paragraph describing six options does not.
  • Label code fences and expand acronyms once. Both readers benefit; neither has your context.

10 / CraftHouse rules for Markdown that stays readable

Markdown's tolerance is its weakness. Four ways of writing the same list all render identically, so a repository with five contributors accumulates five dialects. Pick rules, write them down, and let a formatter enforce them.

One H1 per file

The document title. Every other heading is H2 or below, and levels are never skipped. Skipping H2 to reach H3 breaks outlines, anchors and screen readers.

Hyphens for bullets

Pick - and never mix. Same for emphasis: asterisks, always. Consistency here is worth more than any individual choice.

Lazy numbering

Write 1. for every ordered item. Renderers count for you and reordering never leaves you with 1, 2, 2, 3.

One sentence per line

Optional but transformative for review: diffs then show the sentence that changed rather than a reflowed paragraph. Renderers join the lines anyway.

Reference links for heavy linking

Keeps prose readable in source form and gives you one place to update a URL that appears six times.

Always tag code fences

```bash, not bare backticks. Highlighting, copy buttons and doc tooling all depend on it.

Alt text, every image

If the image carries meaning, describe it. If it is decorative, say so with empty alt text deliberately.

Blank lines around blocks

Before and after every heading, list, table and fence. Most "why won't this render" bugs are a missing blank line.

Then automate it: markdownlint for structure, prettier for formatting, lychee for dead links, all in CI. Style arguments in review are a waste of two people's attention.

11 / DebuggingWhy your Markdown isn't rendering

Nearly every rendering bug comes from one of nine causes. In rough order of frequency:

My heading shows up as text with a hash in front

There is no space after the hashes. #Heading is literal text; # Heading is a heading. CommonMark requires the space. Original Markdown did not, which is why old files sometimes render differently in modern tools.

My list is rendering as one paragraph

Missing blank line before the list. A list that starts immediately after a line of prose gets absorbed into that paragraph by most renderers. Add a blank line above it.

My line breaks disappeared

Single newlines are ignored inside a paragraph — that is by design. Use two trailing spaces, a trailing backslash, or a blank line for a new paragraph. Some tools (GitHub comments, chat apps) break on single newlines, which is why the same text behaves differently in an issue than in a .md file in the same repository.

My table isn't a table

Tables are a GFM extension, so first check the renderer supports them. Then check the separator row exists directly under the header (| --- | --- |) and that the cell count matches the header row. And put a blank line above the table.

My nested list flattened out

Indentation is wrong or mixes tabs with spaces. Use two or four spaces consistently. Under an ordered list, nested content typically needs to align with the text of the parent item, not the number.

Underscores in my filenames turned into italics

Wrap the identifier in backticks as inline code — which you should have done anyway — or escape with backslashes. This is why asterisks are the safer emphasis marker: underscores mid-word are ambiguous.

My HTML was stripped

The renderer is sanitising. GitHub filters dangerous tags after conversion; many CMSs strip HTML entirely. Assume raw HTML is a local optimisation, not a portable feature.

It renders on GitHub but not on our docs site

You are using a GitHub-renderer feature that isn't in the GFM spec: alerts, Mermaid diagrams, footnotes, maths, emoji shortcodes, issue references. All of those are proprietary rendering, not specification. See flavours.

My front matter is printing at the top of the page

The tool rendering the file does not know about front matter — it is not part of any Markdown spec, only a convention that generators implement. Either the delimiters are wrong (it must be --- on the very first line, no blank line above) or the renderer simply doesn't strip it.

The universal debugging move

Paste the snippet into the CommonMark Dingus and then into Babelmark. The first tells you what the specification says should happen. The second tells you what twenty implementations actually do. If they agree and your tool disagrees, the bug is in your tool's configuration — not in your Markdown.

12 / GlossaryThe vocabulary

TermMeaning
ATX headingThe # style of heading, named after Aaron Swartz's atx format
Setext headingThe underlined style, using === or --- beneath the text. Two levels only
Fenced code blockCode delimited by three backticks or tildes, optionally with a language identifier
Front matterA YAML, TOML or JSON metadata block at the top of a file, fenced by ---. Not part of Markdown itself
Flavour / dialectA specific implementation's version of Markdown, including whichever extensions it supports
ExtensionSyntax beyond the core spec — tables, footnotes, task lists, callouts
Renderer / parserThe software that turns Markdown source into HTML or another output format
ASTThe abstract syntax tree a parser builds before rendering. Tools like remark let you transform it directly
Round-tripConverting out of Markdown and back again. Lossy; avoid as a workflow
Wiki link[[Double bracket]] internal links — an Obsidian-family convention, not standard Markdown
Progressive disclosureLoading only the part of a document that the current task needs — the organising principle of the SKILL.md format

14 / FAQShort answers

What is an MD file?

A plain text document written in Markdown, a lightweight markup syntax created in 2004. Punctuation characters express structure — # for headings, ** for bold, - for bullets — and a renderer converts them to HTML or another format. It opens in any text editor on any operating system.

How do I open an MD file?

Any text editor opens it as-is. To see it formatted, use VS Code's preview (Ctrl/Cmd+Shift+V), a Markdown app such as Obsidian or Typora, a browser extension, or the viewer on this page. On iPhone, the Files app shows it as text; a Markdown app renders it.

Is .md the same as .markdown?

Yes — identical content, different extension. .md won on brevity. You will also meet .mdown, .mkd, and specialised variants like .mdx, .qmd and .rmd that add capabilities on top.

Can I open an MD file in Word?

Word will open it as plain text, showing the syntax characters. For a properly formatted document, convert first — pandoc notes.md -o notes.docx, or upload to Google Docs and download as .docx.

Is Markdown a programming language?

No. It is a markup syntax — it describes structure, not behaviour. There are no variables, conditions or loops. It is closer to formatting conventions in email than to code.

What's the difference between Markdown and CommonMark?

CommonMark is Markdown, specified precisely. The 2004 original left many cases ambiguous, so implementations diverged. CommonMark defines the behaviour exactly, with hundreds of test cases. Most modern tools follow it.

Why do AI tools output Markdown?

Because it carries structure at almost no syntactic cost, it renders in most chat interfaces, and it is legible if it isn't rendered. The same properties make it the format of choice for instructing agents — see section 09.

Is Markdown good for SEO?

Markdown is a source format; search engines see the HTML it produces. What helps is the discipline it encourages: a clean heading hierarchy, real lists, descriptive link text and alt attributes. Those matter for both search crawlers and for models retrieving your content.

Do I need to learn all of it?

Headings, bold, italic, lists, links and code fences cover about 95% of real usage. That is roughly six characters of syntax and takes ten minutes. Everything else in this page is reference material for when you meet it.

SourcesWhere the specifics come from

Verified against these sources on 9 August 2026. Specifications and product documentation change; check the primary source before quoting a version number.

About the author

Emil Krzemiński is the founder of auxfirst, an agentic experience design agency. This guide exists because a file format most people ignored for twenty years quietly became the way businesses hand knowledge to machines — and that makes it a design decision, not a formatting one.

Related reading: Markdown for AI · What is agentic user experience? · Agent-first design · The 10 AUX heuristics · How machines read auxfirst. Subscribe on Substack.

auxfirst designs agentic experiences — the interface layer between people, brands and autonomous systems. This reference exists because the file formats agents read are becoming a design surface, and most teams are still treating them as plumbing.

Markdown for AI · What is agentic user experience? · Five steps to becoming an agentic organisation · More from the newsroom