Esta página aún no está traducida al español, así que la mostramos en inglés.

XML Formatter & Validator — Beautify XML Online

Turn minified or messy XML into clean, indented markup and check that it is well-formed — for feeds, sitemaps, SOAP messages, configs and SVG.

Actualizado el
Open file
Indent

Tus datos nunca salen de tu ordenador. Todo se procesa localmente en tu navegador.

Cómo usar: XML Formatter

  1. Paste XML or open a file such as .xml, .rss, .svg or .plist.
  2. Choose 2 spaces, 4 spaces or tabs for indentation.
  3. If the XML is not well-formed, the error and line number are shown.
  4. Copy or download the formatted result.

What is an XML formatter?

An XML formatter (or pretty-printer) re-indents a document so every element starts on its own line and nesting is visible at a glance. It is the fastest way to read an API response, a minified feed, a generated sitemap or a configuration file that arrived as one long line.

<catalog><product id="KB-001"><name>Keyboard</name></product></catalog>

becomes

<catalog>
  <product id="KB-001">
    <name>Keyboard</name>
  </product>
</catalog>

Well-formedness check

Before formatting, the document is parsed with the browser’s XML parser. Well-formed XML must follow a few strict rules — breaking any of them produces an error with the line number:

  • Exactly one root element.
  • Every start tag has a matching end tag, or is self-closing (<br/>), and tags nest properly.
  • Attribute values are quoted, and no attribute appears twice on one element.
  • & and < in text are escaped as &amp; and &lt; (or placed in CDATA).
  • Element names are case-sensitive: <Item> is not closed by </item>.

Validation against a schema (XSD, DTD) is a separate step that checks which elements are allowed; well-formedness is the prerequisite for it.

Formatting rules

Elements that contain only text stay on one line (<price>89.99</price>), empty elements are kept compact, and CDATA sections and processing instructions are preserved unchanged. Need the opposite? The XML minifier removes the indentation again. Working with JSON instead? Use the JSON formatter.

También se busca como: beautify xml, xml pretty print, xml validator, format xml online, xml viewer, indent xml.

Herramientas que combinan con: XML Formatter

  • HTML Formatter — Paste minified or messy markup and get clean, consistently indented HTML — including embedded <style> and <script> blocks.
  • Sitemap Validator — Find and validate your XML sitemap — URL count, sitemap index children, lastmod coverage, duplicates and foreign-host URLs — and check that the pages it lists really return 200.
  • SVG Optimizer — Clean up SVGs exported from Figma, Illustrator, Inkscape or Sketch with SVGO — and check the before/after preview to make sure the icon still looks right.
  • CSS Formatter — Turn a minified stylesheet into readable CSS with one property per line and properly nested @media blocks.

Preguntas frecuentes

How do I validate XML online?
Paste it above. If the document is not well-formed, the parser error and its line number are shown; otherwise the formatted XML appears.
Does formatting change my data?
Only whitespace between tags changes. Text inside elements, attribute values and CDATA sections are kept as they are.
Can it format SVG and RSS?
Yes. SVG, RSS, Atom, sitemaps, SOAP, plist and other XML-based formats all work.
Is my XML sent to a server?
No. Parsing and formatting run in your browser.
¿Puedo instalar XML Formatter como aplicación web y utilizarla sin conexión?
Sí. XML Formatter es una aplicación web instalable (PWA): se instala desde el navegador, no se descarga desde una tienda de aplicaciones. Haz clic en «Instalar aplicación» en la parte superior de esta página en Chrome o Edge (Windows, macOS, Linux, ChromeOS) o, en Android, utiliza «Compartir» → «Añadir a la pantalla de inicio» en iPhone y iPad, o «Archivo» → «Añadir al Dock» en Safari 17+ en un Mac. A continuación, se abrirá en su propia ventana con su propio icono y, como se ejecuta íntegramente en tu navegador, seguirá funcionando sin conexión. Firefox en el ordenador de sobremesa no permite instalar aplicaciones web. Cómo funciona la instalación.

Herramientas relacionadas