Media and documents · Comparison

Markdown vs MDX

MDX is Markdown plus components. The extra power suits interactive docs and blogs, but it makes files stricter and turns content into code.

2 options · 7 questions side by side · updated

CompareMarkdownMDX
What it isPlain-text formatting syntaxMarkdown plus JSX components
OutputHTMLJavaScript components that render HTML
Components and codeNone; raw HTML at mostImports, JSX and JavaScript expressions
StrictnessForgiving; mistakes still renderStrict; a typo can break the build
Where it worksAlmost everywhere: GitHub, editors, CMSs, chatSites with an MDX build step or runtime
Untrusted contentFine once the HTML is sanitisedNever compile MDX written by users
Best forREADMEs, notes and simple blog postsDocs and blogs with interactive parts

How to choose between Markdown and MDX

  • Pick Markdown for portable content that many tools and writers can edit.
  • Pick MDX when pages need live components such as charts, tabs or demos, and a developer looks after the build.
  • Most MDX setups also accept plain .md files, so a site can mix both.

The options

More comparisons

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.