About the XML Formatter playground

The XML Formatter pretty-prints compact or minified XML into a clean, indented document tree. It places each element on its own line, indents nested children, and tidies attribute spacing so the hierarchy is easy to read. It can also collapse formatted XML back to a compact form. Processing happens entirely in your browser, so configuration files, SOAP payloads, and feeds with sensitive data are never uploaded.

XML (eXtensible Markup Language) is a self-describing, tree-structured format used for configuration, documents, RSS and Atom feeds, SOAP web services, and data exchange between systems. Its verbose, nested syntax is precise but hard to read when stripped of whitespace. Reformatting restores the indentation that reveals parent/child relationships, making it far easier to navigate large documents, debug feeds, and confirm that elements are properly nested and closed.

HostedXML Formatter runtime
mainentry file
single fileworkspace
stdinprogram input

How it works

1

Write

The main file is the entry point for each run.

2

Give it input

Use the Input panel to pipe standard input to your program when it needs data.

3

Run

Run sends your code to a fresh hosted runtime and streams the result into the output panel.

4

Keep or share

Your draft stays in this browser, and Share creates a separate snapshot link.

External resources

  • w3.org/XML— Official website

Messy input

<note><to>Ada</to><from>Bob</from><body>Hi there</body></note>

Formatted output

<note>
  <to>Ada</to>
  <from>Bob</from>
  <body>Hi there</body>
</note>

With attributes

<catalog>
  <book id="b1" lang="en">
    <title>XML Basics</title>
    <price>29.99</price>
  </book>
</catalog>

RSS feed formatted

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>News</title>
    <item>
      <title>First post</title>
      <link>https://example.com/1</link>
    </item>
  </channel>
</rss>

Namespaced messy input

<h:table xmlns:h="http://www.w3.org/TR/html4/"><h:tr><h:td>Apples</h:td><h:td>Bananas</h:td></h:tr></h:table>

Namespaced formatted output

<h:table xmlns:h="http://www.w3.org/TR/html4/">
  <h:tr>
    <h:td>Apples</h:td>
    <h:td>Bananas</h:td>
  </h:tr>
</h:table>

CDATA and comment formatted

<config>
  <!-- connection settings -->
  <db>
    <query><![CDATA[SELECT * FROM users WHERE id < 10]]></query>
  </db>
</config>

SOAP envelope messy input

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><getPrice><item>Apples</item></getPrice></soap:Body></soap:Envelope>

SOAP envelope formatted output

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <getPrice>
      <item>Apples</item>
    </getPrice>
  </soap:Body>
</soap:Envelope>

Mixed empty elements formatted

<form>
  <field name="email" type="text" />
  <field name="agree" type="checkbox" />
  <submit label="Send" />
</form>

How it works

The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.

What it does

Paste compact or minified XML and it pretty-prints an indented document tree.

Each element is placed on its own line with nested children indented.

Can also collapse formatted XML back to a compact form.

Formatting behavior

Attribute spacing is tidied so the hierarchy is easy to read.

Restores indentation that reveals parent/child relationships.

Handles config files, SOAP payloads and RSS/Atom feeds.

Privacy

Processing happens entirely in your browser; XML is never uploaded.

Feeds and payloads with sensitive data stay on your machine.

Tips

Copy the formatted XML to navigate large documents more easily.

Helps confirm that elements are properly nested and closed.

Every shortcut, searchable:

Editing

Undo
Ctrl+Z
Redo
Ctrl+⇧+Z
Select next occurrence
Ctrl+D
Delete line
Ctrl+⇧+K
Move line up / down
Alt+↑ / ↓
Copy line up / down
Alt+⇧+↑ / ↓
Toggle comment
Ctrl+/
Indent line
Ctrl+]
Outdent line
Ctrl+[

Navigation

Find
Ctrl+F
Find & replace
Ctrl+H
Go to line
Ctrl+G
Go to symbol
Ctrl+⇧+O

Selection

Select all
Ctrl+A
Select line
Ctrl+L
Select all occurrences
Ctrl+⇧+L
Shortcuts follow your OS — ⌘ becomes Ctrl on Windows and Linux.
It reformats minified or messy XML into a clean, indented tree that reflects element nesting, and can also minify it back to a compact form.
No. Everything runs in your browser, so XML documents and any sensitive content stay entirely on your device.
Yes, it is completely free with no sign-up and no limits.
Yes. You can set the indent size in spaces or use tabs to match the conventions of your project.
Yes. Attributes are kept on their element, and CDATA sections, comments, and namespace prefixes are preserved during formatting.
Input
Output

Output

Start typing to auto-process

>_compilebytes

A fast place to write code and run it in isolated hosted runtimes. Free, forever.

Playgrounds

Python compilerC compilerJavaScript compilerC++ compilerTypeScript compilerGo compilerJava compilerRust compiler
All playgrounds →

Tools

JSON formatterRegex testerBase64 encoderJWT decoder
JSON formatterBase64 encoder & decoderRegex testerJWT decoder
All tools →

Company

TermsPrivacy[email protected]
© 2026 compilebytes115 runtimes · no signup115 runtimes · isolated sandboxes · no signup