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

MDX Formatter

Format and beautify MDX files

Deploy formatted MDX as live docs

Jamdesk formats your MDX automatically when you deploy. Learn more →

How to Format MDX

Paste your MDX into the editor and the formatter will apply consistent indentation, normalize frontmatter spacing, and clean up JSX component formatting. The formatter preserves your content while fixing whitespace issues, aligning attributes, and ensuring consistent line breaks between sections. It handles mixed Markdown and JSX syntax correctly, so component props stay readable alongside your prose. The output is ready to commit — no manual cleanup needed.

Frequently Asked Questions

Does the formatter change my content?
No. The formatter only adjusts whitespace, indentation, and formatting. Your actual content, component props, and frontmatter values are preserved exactly as written.
Does it handle frontmatter?
Yes. The formatter correctly handles YAML frontmatter blocks, preserving their structure while normalizing spacing and indentation within the frontmatter section.
What formatting rules does it follow?
The formatter uses Prettier with MDX support. It applies standard Prettier rules for Markdown and JSX, including consistent indentation, line wrapping, and attribute alignment.
Can I configure the formatting options?
The formatter uses sensible defaults that work for most MDX files. Custom configuration options like tab width and print width are planned for a future update.

Related Tools