Skip to content
DoCodeHereDeveloper tools and services

Code editors and AI coding tools · Researched comparison

Best XML Formatter Tools in 2026

Visual Studio Code with an XML extension is the first pick for most developers. It formats XML inside the editor you already use, on Windows, macOS and Linux, and the editor is free. If you want a dedicated editor that validates and formats XML as you type, pick Oxygen XML Editor. If you need formatting in a build or script, pick the xmllint tool from libxml2 or the Eclipse XML editor.

By · Published 22 Nov 2026

We run no ads and no affiliate links at launch. The order of a list follows our published method.

Prices are the starting prices vendors list publicly. Plans change, so confirm the current price on the vendor page before you buy.

Key takeaways

ToolBest forStandout featureListed starting priceFree plan or trial
1 Visual Studio CodeDevelopers who want XML formatting inside a general code editorFree and cross-platformFreeFree plan
2 Oxygen XML EditorTeams that work with XML, schemas and XSLT all daySchema-aware formatting and validationSee vendor pricing pageFree trial (30 days)
3 xmllint (libxml2)Scripts, CI jobs and terminal users who need XML formattingShips with libxml2 on most Linux and macOS systemsFree (open source)Free plan
4 Eclipse IDE with the XML editorJava developers who already work in EclipseFree and open sourceFree (open source)Free plan
5 Notepad++Windows users who want a light editor with XML formattingFree, fast and smallFree (open source)Free plan
6 Sublime TextDevelopers who want a fast editor with XML formatting packagesFast and cross-platformSee vendor pricing pageFree trial (no time limit, with purchase prompts)
7 IntelliJ IDEAJetBrains users who want XML formatting in the same IDEBuilt-in XML formatter and validationSee vendor pricing pageFree trial (30 days)

How we picked

We picked tools that genuinely format XML, not just display it. Criteria were fit for the job (indentation, validation, schema support), platforms, price and licence, privacy of pasted data, and main limits. Sources are vendor pages, official documentation and project repositories. We did not run benchmarks or surveys. Prices change, so confirm on the vendor site before you buy.

01

Visual Studio Code

Best for: Developers who want XML formatting inside a general code editor

Visual Studio Code is a free code editor from Microsoft that runs on Windows, macOS and Linux. It has a built-in "Format Document" command that handles XML indentation. For richer support, install the Red Hat XML extension, which adds formatting, validation against XSD and DTD schemas, and autocomplete. The extension is open source and free.

Formatting settings such as tab size and line width are configurable per workspace, so teams can share one style. The editor also has a built-in diff view, which helps when you reformat a large file and want to check what changed. There is no paid tier.

Skip VS Code if you need a dedicated XML IDE with XSLT debugging and visual schema tools. For plain formatting and light validation, it covers most day-to-day work.

Pros

  • Free and cross-platform
  • large extension ecosystem for XML support

Cons

  • XML formatting depends on extensions
  • no built-in schema validation

Price: Free, as listed by the vendor (Visual Studio Code website). Confirm the current plan price before you buy.

Skip it if this limit matters to you: XML formatting depends on extensions.

Verdict. A sensible pick for developers who want XML formatting inside a general code editor.

02

Oxygen XML Editor

Best for: Teams that work with XML, schemas and XSLT all day

Oxygen XML Editor is a dedicated XML editor from Syncro Soft. It formats XML with awareness of the schema, so indentation and validation follow the document's XSD, DTD or RELAX NG definition. It also supports XSLT and XQuery debugging, XPath evaluation and visual editing of XML documents.

It runs on Windows, macOS and Linux as a desktop application. There is also an Eclipse plugin variant. The product is commercial, with a free 30-day trial. Licence types include named-user and floating options; check the vendor page for current prices.

This is the pick for people whose main job is XML: documentation teams, publishing pipelines and integration work. Skip it if you only format XML occasionally, since a free editor covers that.

Pros

  • Schema-aware formatting and validation
  • strong XSLT and XQuery support

Cons

  • Paid licence
  • heavier than a general code editor

Price: See vendor pricing page, as listed by the vendor (Oxygen XML Editor website). Confirm the current plan price before you buy.

Skip it if this limit matters to you: paid licence.

Verdict. A sensible pick for teams that work with XML, schemas and XSLT all day.

03

xmllint (libxml2)

Best for: Scripts, CI jobs and terminal users who need XML formatting

xmllint is a command-line XML tool that is part of the libxml2 project. The `--format` option reformats XML with consistent indentation, and `--pretty` prints a readable version. It also validates against schemas and parses documents, so one tool covers formatting and checks in a pipeline.

It is free and open source under the MIT licence. It is available on Linux and macOS through package managers, and on Windows through builds of libxml2. Because it runs locally, no document leaves your machine, which matters for configuration files and internal data.

The formatting style is fixed, so it is not the tool for enforcing a custom indentation scheme. Skip it if you need a visual editor; use it when you want repeatable formatting in a script.

Pros

  • Ships with libxml2 on most Linux and macOS systems
  • scriptable

Cons

  • Command-line only
  • limited formatting options

Price: Free (open source), as listed by the vendor (xmllint (libxml2) website). Confirm the current plan price before you buy.

Skip it if this limit matters to you: command-line only.

Verdict. A sensible pick for scripts, CI jobs and terminal users who need XML formatting.

04

Eclipse IDE with the XML editor

Best for: Java developers who already work in Eclipse

Eclipse is a free, open-source IDE that runs on Windows, macOS and Linux. Its Web Tools Platform includes an XML editor with a formatter, validation against DTD and XSD, and a structured outline view. You can format a document or a selection with the editor's format command.

Because it is an IDE, the XML editor is one part of a larger install. If your team already uses Eclipse for Java, adding XML formatting costs nothing extra. Formatting preferences are stored per workspace, so a team can share a style.

Skip Eclipse if you do not otherwise use it. The download and setup are large for a formatting task, and a lighter editor or xmllint will be faster.

Pros

  • Free and open source
  • XML editor with formatting and validation built into the IDE

Cons

  • Heavy install for XML alone
  • formatting options tied to the IDE

Price: Free (open source), as listed by the vendor (Eclipse IDE with the XML editor website). Confirm the current plan price before you buy.

Skip it if this limit matters to you: heavy install for XML alone.

Verdict. A sensible pick for java developers who already work in Eclipse.

05

Notepad++

Best for: Windows users who want a light editor with XML formatting

Notepad++ is a free, open-source text editor for Windows. The XML Tools plugin adds "Pretty print" formatting, XML validation and XPath evaluation. Without the plugin, the editor handles XML as plain text.

It is a good fit for quick edits on Windows machines where a full IDE is overkill. The plugin is installed through the editor's plugin manager. Formatting options are limited compared with a schema-aware editor, but for tidying a config file it is enough.

Skip it if you work on macOS or Linux, or if you need schema validation as part of formatting. In those cases use VS Code or Oxygen.

Pros

  • Free, fast and small
  • XML Tools plugin adds pretty-print and validation

Cons

  • Windows only
  • formatting needs a plugin

Price: Free (open source), as listed by the vendor (Notepad++ website). Confirm the current plan price before you buy.

Skip it if this limit matters to you: windows only.

Verdict. A sensible pick for windows users who want a light editor with XML formatting.

06

Sublime Text

Best for: Developers who want a fast editor with XML formatting packages

Sublime Text is a cross-platform text editor for Windows, macOS and Linux. XML formatting is available through packages such as the built-in reindent command and third-party XML packages that add pretty-printing and validation. The editor is fast on large files, which helps with big XML documents.

The licence is paid; the vendor page lists current prices. The editor can be evaluated for free with periodic purchase prompts. Formatting quality depends on the package you install, so check that the package is maintained.

Skip it if you want XML formatting and validation out of the box. Oxygen or VS Code with the Red Hat extension need less setup.

Pros

  • Fast and cross-platform
  • package ecosystem adds XML formatting

Cons

  • Paid licence for continued use
  • XML support comes from packages

Price: See vendor pricing page, as listed by the vendor (Sublime Text website). Confirm the current plan price before you buy.

Skip it if this limit matters to you: paid licence for continued use.

Verdict. A sensible pick for developers who want a fast editor with XML formatting packages.

07

IntelliJ IDEA

Best for: JetBrains users who want XML formatting in the same IDE

IntelliJ IDEA is a JetBrains IDE for Windows, macOS and Linux. It includes an XML formatter with configurable indentation, wrapping and attribute ordering, plus validation against schemas. Formatting follows the IDE's code style settings, which can be shared through a project.

The full edition is commercial, with a free 30-day trial; the vendor page lists prices. A free Community edition exists, but its XML support is more limited than the full edition. Check the feature comparison before relying on it for schema-heavy work.

Skip it if you do not use JetBrains tools. The install is large, and a lighter editor covers plain XML formatting.

Pros

  • Built-in XML formatter and validation
  • consistent with other JetBrains tools

Cons

  • Paid for the full edition
  • heavy for XML alone

Price: See vendor pricing page, as listed by the vendor (IntelliJ IDEA website). Confirm the current plan price before you buy.

Skip it if this limit matters to you: paid for the full edition.

Verdict. A sensible pick for jetBrains users who want XML formatting in the same IDE.

Who should use what

If you already write code in VS Code, add the Red Hat XML extension and format there for free. If XML is your main work, with schemas and XSLT, Oxygen XML Editor is built for that job. If you need formatting in a script or CI job, use xmllint so the same command runs everywhere. If you are on Windows and want something small, Notepad++ with the XML Tools plugin is enough. Avoid online formatters for anything private.

What to check before you buy

FAQ

What is the best free XML formatter?

Visual Studio Code with the Red Hat XML extension is free and cross-platform. xmllint is free and works on the command line. Notepad++ with the XML Tools plugin is free on Windows. All three format XML locally, so your data stays on your machine.

Can I format XML without installing anything?

Yes. Online XML formatters work in the browser with no install. Use them only for public or dummy data. Do not paste secrets, tokens or production configuration into a third-party page. For private files, a local editor or xmllint is safer.

Does formatting XML change the data?

No. Formatting changes whitespace between elements, not element names, attributes or text content. Be careful with mixed content, where whitespace inside text is significant. Check the result before committing a reformatted file.

What is the difference between formatting and validating XML?

Formatting indents the document so it is easier to read. Validation checks the document against a schema or DTD and reports errors. Some tools, such as Oxygen XML Editor and the Red Hat XML extension, do both.

Which tool formats XML in a CI pipeline?

xmllint is the usual choice. It runs on the command line, ships with libxml2 on most Linux and macOS systems, and can format and validate in one step. Add it to a build script so formatting is checked on every commit.

Sources we checked

  1. Visual Studio Code (official site)
  2. Oxygen XML Editor (official site)
  3. xmllint (libxml2) (official site)
  4. Eclipse IDE with the XML editor (official site)
  5. Notepad++ (official site)
  6. Sublime Text (official site)
  7. IntelliJ IDEA (official site)

Change log. First published 22 Nov 2026.