Developer tool

Power Query M Formatter

Format Power Query M code locally with comments and quoted strings preserved.

HOW IT WORKS

Why format Power Query M?

M queries often combine nested let expressions, record access, lists and commented steps. Readability matters when another analyst must review the transformation pipeline. This formatter scans M tokens, including quoted identifiers, strings, and comments. It formats let bindings while leaving short field access [Amount], record literals [Name="x"] and navigation selectors {[Name="x"]} intact. It verifies that the original token sequence is unchanged. It is not a full parser and does not validate Power Query semantics.

Worked example

Paste a let expression, choose Format M, then compare the result against your original query in Power Query. For example, a query using Table.SelectRows and Table.SelectColumns should preserve literal column names and filter expressions.

Important assumptions and limitations

Power Query M and DAX are different languages. Use a dedicated DAX formatter for DAX. Review the outcome in Microsoft Power Query before using it in production.

How to use this tool

Enter valid input in the fields above and run the calculation or conversion. Review the displayed result, assumptions and any warnings before reusing the output. Where available, download or copy the result directly from your browser.

Frequently asked questions

Is this tool free?

Yes. It works without an account or registration.

Does the tool require a server?

The calculation runs in your browser with local JavaScript. A network connection is only needed to load the website.

Can I use the result professionally?

Check important results against a trusted source, especially for financial, legal and tax decisions. See the stated assumptions for this tool.

Further information

Read the source documentation ↗