Power Query M Formatter

Paste M code, click Format. Everything runs in your browser and nothing is uploaded.

Input

Formatted code

Why format your M code?

Power Query queries written through the Power BI or Excel interface often end up as long, unindented steps. Consistent formatting makes each transformation step easy to scan, review and compare in version control, and it makes mistakes like a missing comma or bracket much easier to spot.

This formatter uses Microsoft's open-source Power Query formatter, so the output follows the same rules as Microsoft's own tooling. Your code is processed locally in your browser and is never sent to a server.