ToolLineup

XAML Formatter

Re-indent a XAML file so its visual tree is readable at a glance, or minify it. The summary separates controls from property elements — the Owner.Property form such as Grid.RowDefinitions sets a value rather than adding anything to the tree, so counting them together would overstate what the file declares — and reports the namespaces it uses, how many attributes use a markup extension such as Binding, and how deep the layout nests.

How it works

Re-indents the visual tree so nesting is visible at a glance, which is the main thing that makes a hand-edited or tool-generated XAML file hard to read.

The summary separates controls from property elements — the Owner.Property form such as Grid.RowDefinitions sets a value rather than adding anything to the tree, so counting them together would overstate how much the file actually declares.

Everything runs in your browser — nothing you paste is uploaded.

Nothing pasted yet
XAML input
Paste a XAML window, page, control or resource dictionary…
Formatted XAML

Frequently asked questions

What is a property element and why is it counted separately?

A property element uses the Owner.Property form — Grid.RowDefinitions, ListView.View — and sets a value on its parent rather than adding a control to the visual tree. Counting them alongside real controls would badly overstate how much the file actually declares, so they are reported on their own line.

Why does nesting depth matter?

A deep visual tree is the usual cause of slow layout passes, because each level adds work to every measure and arrange cycle. Extracting parts into their own controls or templates generally helps more than tuning individual elements, which is why the depth is surfaced.

Does this work for WPF, WinUI, MAUI and Xamarin?

Yes — all four use XAML, and the formatter works on the markup itself rather than on any particular framework, so the indentation and the summary apply equally to all of them.

What counts as a binding?

Any attribute whose value uses a markup extension in curly braces — Binding, StaticResource, DynamicResource, TemplateBinding, x:Static and RelativeSource — is counted, which gives a quick sense of how much of the file is data-driven.

Will formatting break my XAML?

No. Only whitespace between elements changes; attributes, their order and their values are untouched, and comments are preserved rather than being dropped.

Related tools