Best for
Markdown
Portable docs, specs, READMEs, prompts, and design.md files.
MDX
Docs websites, component demos, interactive examples, and rich guides.
Markdown is best for portable text documentation. MDX is best when a Markdown-like page also needs JSX components, live examples, or interactive UI. Use Markdown for durable specs like design.md; use MDX for component-rich docs websites.
Markdown
Portable text files that work almost everywhere.
MDX
Markdown plus JSX components for rendered web pages.
Rule of thumb
Choose Markdown for interchange. Choose MDX for interactive docs.
Comparison
Markdown is a simple syntax for text documents. MDX is a superset-like authoring format that can include Markdown and JSX. The right choice depends on whether the raw file needs to stay portable or the rendered page needs to be interactive.
Markdown
Portable docs, specs, READMEs, prompts, and design.md files.
MDX
Docs websites, component demos, interactive examples, and rich guides.
Markdown
Plain text formatting: headings, lists, links, code, and tables.
MDX
Markdown plus JSX imports, exports, expressions, and components.
Markdown
Works in most editors, repos, chat tools, and documentation systems.
MDX
Needs an MDX compiler and a compatible app or documentation framework.
Markdown
Very high. The file stays useful even without a web build.
MDX
Lower. JSX parts depend on the components and runtime around the file.
Syntax
Both examples describe a primary button. The Markdown version is plain text. The MDX version depends on a component import and a renderer that knows what `ButtonPreview` means.
button.md
# Button
Use the primary button for the most important action.
- Background: #10b981
- Radius: 5px
- Padding: 12px 18pxbutton.mdx
import { ButtonPreview } from "./ButtonPreview";
# Button
Use the primary button for the most important action.
<ButtonPreview variant="primary" />FAQ
Short answers for searchers comparing `.md` and `.mdx` files for documentation, design systems, and AI workflows.
Markdown is a plain-text formatting syntax. MDX extends Markdown with JSX, so an `.mdx` file can render UI components inside the content.
Usually yes. `.md` is the common file extension for Markdown files, so MD vs MDX normally means Markdown files compared with MDX files.
MDX is better for interactive web docs. Markdown is better for portable text, simple editing, code review, prompts, and agent-readable documentation.
A design.md should usually stay plain Markdown because the goal is portability. Agents, engineers, and designers can read the same file without needing a component runtime.
Related docs
Definition
Learn what a design.md contains, why Markdown is useful for design systems, and how agents use it as implementation context.
Definition
A concise answer-first guide to MDX, including syntax, build requirements, use cases, and common tradeoffs.
Developer guide
Use hosted keyless extraction with JSON, Markdown, or MDX outputs, plus purchased AI runs and Docker/self-hosted environment keys for private AI enrichment.
Paste a URL and get a design.md file that can move through Git, chat, docs, pull requests, and agent workflows without needing an MDX runtime.