Format M Code

Paste a Power Query M snippet — a full let … in … query or a bare expression — and get canonical formatting back. Choose long lines (Power Query editor style) or short lines (spreads complex function calls across lines for readability). Use Validate to parse-check without reformatting.

Attribution

Formatting and parsing are powered by Microsoft's official MIT-licensed libraries: @microsoft/powerquery-formatter and @microsoft/powerquery-parser. The same engines back VS Code's Power Query extension. This tool is also exposed via the MCP server as format_m_code and validate_m_code.