Media and documents · Format

MDX

Markdown that can also contain React-style components, so a blog post or documentation page can include live charts, callouts, tabs or interactive demos.

Writing formats · Open source · updated

How it works

An MDX file is compiled to JavaScript. Headings, lists and links are written as ordinary Markdown, and between them you can import and place JSX components such as a chart with its data, use JavaScript expressions in curly braces, and export values. It works with React, Preact, Vue and other JSX runtimes, and frameworks such as Next.js, Astro, Docusaurus and Nextra support it; remark and rehype plugins add GFM tables, maths and syntax highlighting.

It is stricter than Markdown. Raw HTML must be valid JSX, characters such as < and { need escaping, and indented code blocks and angle-bracket autolinks are not supported, so converting existing Markdown takes some clean-up. Because MDX compiles to code, content from untrusted users should never be compiled as MDX.

MDX pricing

Open source

Free (MIT).

Approximate, checked September 2026.What the other tools cost

MDX vs the alternatives

More in Media and documents

Writing formats

All 14 Media and documents terms

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.