XML / JSON / SQL Code Formatter
Paste XML, JSON, or SQL and get clean, indented output in one click - in your browser.
What is a code formatter?
A code formatter takes source that is minified or carelessly indented and rewrites it with consistent line breaks and indentation, so the structure is obvious at a glance. This hub handles the three formats web and data work touch most often. XML is a tree of nested elements - a formatter puts each element on its own line and indents children under their parent. JSON shares that nested shape, built from objects and arrays, and reads far more easily once each key sits on its own indented line. SQL is different: it is a sequence of clauses, so formatting it means breaking the query at SELECT, FROM, WHERE, JOIN, and the other clause keywords and lining them up. In every case the meaning of the code is unchanged - only its layout improves - and all of it happens in your browser, with nothing sent to a server.
How to use the code formatter
- Choose the language. Click XML, JSON, or SQL in the format selector at the top of the tool. The formatter switches its parser and indent rules to match the language you picked.
- Paste your code. Paste the raw, minified, or broken-indented code into the input panel on the left. Nothing is uploaded and nothing leaves the page - the input stays in your browser until you run it in the next step.
- Click Format. Click the Format button to apply indentation and line breaks. Use the indent chip to switch between 2 spaces, 4 spaces, or a tab. For XML and JSON you can also click Minify to strip all whitespace.
- Copy or download the result. Click Copy to put the formatted code on your clipboard, or Download to save it as a file. Everything stays in your browser - nothing is logged or stored.