JSON Formatter
JSON Formatter for developers — instant, offline-style and privacy-safe.
Beautify minified or one-line XML — each element on its own line, indented by nesting level — right in your browser. A quick regex tidier, not a validating parser.
Your browser is preparing the tool. It runs 100% locally.
Paste compact or one-line XML and the tool reformats it so each element sits on its own line, indented two spaces per nesting level, with text on its own line too. It is a lightweight regex tidier — it does not parse or validate the XML — so it is ideal for a quick read but can stumble on attribute values or CDATA that contain angle brackets. It runs in your browser; nothing is uploaded.
This tool takes XML that has been collapsed onto one line and lays it out with one tag per line and a clean two-space indent for each level of nesting, so the document structure is easy to follow.
It is the quick way to read an API response, a config file or a feed that arrived minified — to see the hierarchy of elements without loading it into an editor or an XML viewer.
The tool first removes whitespace between tags, then splits the text into its tags and text nodes. It walks through those pieces keeping a nesting depth: an opening tag increases it, a closing tag decreases it, and each piece is indented two spaces per level. Declarations, comments and self-closing tags are recognised so they do not wrongly change the depth.
This is pattern-based, not a parse. The tool never builds a document tree or checks that the XML is well formed — it reacts to the shape of the tags. That keeps it fast and dependency-free, and it handles ordinary documents well, while the edge cases a real parser handles can trip it up.
1 · collapse whitespace between tags, then split into tags and text
2 · opening tag → indent deeper · closing tag → step back out
3 · two spaces of indent per nesting level
note: declarations, comments and self-closing tags do not change the depthBefore: <note><to>Tove</to><from>Jani</from></note>
After:
<note> <to> Tove </to> <from> Jani </from>
</note>Text nodes go on their own indented line, so an element's text sits one level deeper than its tags. Self-closing and declaration tags are detected so they do not push the indentation.
Your XML never leaves your device. It is reformatted in your browser with no network request, so nothing is uploaded.
Because the work is local, you can safely tidy private API responses, configs or client data without it being stored or sent anywhere.
Nothing persists between sessions — close the tab and the input and output are gone.
It lays out ordinary, well-formed XML cleanly, but it is a regex tidier, not a parser. It does not check that the document is well formed or that tags match — it only reflows the pieces, so malformed input produces malformed output.
An angle-bracket character inside an attribute value or a CDATA section can break the tag splitting, because the tool keys off those characters rather than understanding quoting and CDATA. A real parser tracks both.
Text nodes are placed on their own indented line, so an element's text appears one level deeper than its surrounding tags. That is readable but differs from formatters that keep short text on the same line as its element.
It does not handle XML-specific niceties like namespace alignment or attribute reordering, and it is not guaranteed idempotent on already-formatted input. For anything beyond a quick read, a parser-based tool is safer.
Expand a minified XML payload into a readable hierarchy.
Lay out an XML configuration file to see its structure.
Format an RSS or sitemap document for a quick scan.
Present XML clearly in documentation.
For a reliable reformat that also checks well-formedness, use a parser-based tool (a DOM parser, xmllint, or your editor's XML plugin). This tool is for a fast in-browser read of a payload.
Re-indents with a regex that splits on tags and counts nesting depth; honest that it does not parse or validate the XML, so attribute values and CDATA with angle brackets can throw it off.
JSON Formatter for developers — instant, offline-style and privacy-safe.
JSON Validator for developers — instant, offline-style and privacy-safe.
Base64 Encoder for developers — instant, offline-style and privacy-safe.
Fast, free Hash Generator that runs entirely client-side in your browser.
Fast, free UUID Generator that runs entirely client-side in your browser.
Fast, free CSS Minifier that runs entirely client-side in your browser.
It is free, private and runs entirely in your browser — no sign-up, no uploads, no limits.