Skip to content
JamdeskUtilities
Free · Open source · Client-side

MDX Validator

Check MDX for syntax errors

New to MDX? Read MDX vs Markdown or browse the MDX cheatsheet.

How to Validate MDX

Paste MDX into the editor and validation runs on its own, about a third of a second after you stop typing. Unclosed JSX tags, mismatched components, unbalanced curly braces, and import statements that won't parse all surface inline with a line number, a column, and a message describing what broke. The parser is remark-mdx, the same one your build uses, so a file that comes back clean here compiles in your project.

How validation works

Your content goes through remark-mdx, the parser behind Next.js, Docusaurus, and Astro. It runs a full parse pass and collects every message the unified pipeline produces, each tagged with a line, a column, and a severity. Validation re-runs 300ms after your last keystroke, which keeps the editor responsive while you type into a large file.

Common errors the validator catches

The usual culprit is a JSX tag nobody closed: a <Callout> with no </Callout>, or a </Note> closing something that was never opened. After that come unbalanced curly braces in expressions, and import statements that fail with an acorn parse error. Strict mode filters the list down to errors only and hides warnings.

What it doesn't check

Frontmatter is treated as an opaque block. remark-mdx marks where it starts and ends but never parses the YAML inside it, so a duplicate key or a tab used for indentation in your frontmatter passes here and still causes trouble at build time. Paste that block into the YAML Validator instead. Imports aren't resolved either, so <Callout> validates whether or not anything named Callout exists in your project.

Checking a whole project

This page handles one file at a time. For a repository, add remark-mdx to CI and fail the build on parse errors. It's the same parser running here, so the results match.

Frequently Asked Questions

Is the MDX Validator free and open source?
Yes. The MDX Validator is free and open source under the Apache 2.0 license. The full source code is on GitHub at github.com/jamdesk/utilities, and there are no ads, accounts, or usage limits.
What errors does the validator catch?
JSX syntax errors (unclosed tags, mismatched components), unbalanced braces in MDX expressions, and import or export statements that fail to parse. Markdown itself is forgiving, so genuine Markdown errors are rare.
Does the validator check my frontmatter?
No. remark-mdx treats frontmatter as an opaque block and doesn't parse the YAML inside it, so invalid YAML passes validation here. Use the YAML Validator for that.
Does validation run automatically?
Yes. It re-runs 300ms after you stop typing. No button to press, and errors appear inline as you edit.
Is this the same as my build-time validator?
It runs remark-mdx, which is what most MDX build tools parse with, so syntax that validates here parses in your project too. It won't catch failures that happen later in a build, such as a component that's imported but doesn't exist.
Can I validate multiple files at once?
Not here. The editor takes one file at a time. Batch validation belongs in your build toolchain, where remark-mdx can run over every file on every commit.

About this tool

The MDX Validator is free and open source. It runs entirely in your browser. Your input is never uploaded, stored, or logged. Open the network tab in your developer tools while the tool runs and you can confirm that for yourself. The full source code is on GitHub under the Apache 2.0 license, so you can read the code, file issues, or fork the project. There are no ads, no accounts, and no usage limits. Built and maintained by Jamdesk.

Maintained by Jamdesk · Last reviewed

Validate MDX on every deploy

Jamdesk validates your MDX automatically, so broken docs never ship. Start for Free

Related Tools