Beautify your Power Query (M-Language) Code with Power Query Formatter

Power Query Formatter is in Beta stadium, so don't expect it to work perfectly. If you encounter any issues please leave us a bug report so we can improve our service.

Theme
format (ctrl+enter)
options
1
2
3
4
5
6
7
8
9
10
 
 
 
 
 
 
 
 
 
 
Place your Power Query Code here
format (ctrl+enter)
options
I will store your preferred options in your browser and remember them when you revisit. Reset to default values.

How the formatter works

The formatter formats by trying to put as many statements as possible in single lines. Once the lines exceed the configured maximum line length the formatter forces the last most expression to break line. If the resulting layout still exceeds the line length the next expression will be forced to break line. The break line behavior is defined seperately for each expression. Some expressions - like e.g. Literals - cannot break line because it doesn't make sense. Other expressions always break line like the let-Expression. You can explore the options tab in the formatter to view the parameter set that the formatter supports.

There is also an Api that you can use to automatically format queries.

The formatter uses your browser database to save your configured options and your last query.