🌐
GitHub
github.com › prettier › plugin-xml
GitHub - prettier/plugin-xml: Prettier XML plugin · GitHub
Same as in Prettier (see prettier docs). ... Adds a space before self-closing tags. ... Orders XML attributes by key alphabetically while prioritizing xmlns attributes.
Author   prettier
Discussions

Format XML
Please add XML format feature. Reference: #505 Prettier has an official plugin for that: https://github.com/prettier/plugin-xml I wonder, Prettier formats xml but not natively xml? Weird, but ok. I... More on github.com
🌐 github.com
2
September 29, 2020
metadata - How can I get `prettier` to properly format perm set XML files with `flowAccess`? - Salesforce Stack Exchange
Apparently there's another prettier plugin that works with something called "flow." I think it's something to do with the Flow Parser, but am not sure. I do see a parser-flow.mjsn file within the prettier package. Regardless, the tag in the XML seems to be getting messed up by this. More on salesforce.stackexchange.com
🌐 salesforce.stackexchange.com
How can I prettify/syntax-hilight xml in the browser using prettier?
I am looking at this example that describes how one can format graphql in the browser. e.g. More on stackoverflow.com
🌐 stackoverflow.com
unix - How can I pretty print XML content from the command line? - Stack Overflow
Related: How can I pretty-print JSON in a shell script? Is there a (Unix) shell script to format XML content in human-readable form? Basically, I want it to transform the following: <... More on stackoverflow.com
🌐 stackoverflow.com
🌐
JSON Formatter
jsonformatter.org › xml-pretty-print
Best XML Pretty Print Online
XML Pretty Print is very unique tool for prettify json and pretty print XML data in color.
🌐
Prettier
prettier.io
Prettier · Opinionated Code Formatter · Prettier
XML · And more... prettier-js prettier.el Apheleia · espresso-prettier · Prettier Prettier⁺ · JsPrettier · vim-prettier neoformat ALE coc-prettier · JavaScriptPrettier · prettier-vscode · Built-in support · Got more?Send a PR · See others · Regularly used by: More than 83% of respondents to State of JS 2021.
🌐
Online XML Tools
onlinexmltools.com › prettify-xml
Prettify XML - Online XML Tools
This tool pretty prints Extensible Markup Language (XML) data files.
🌐
GitHub
github.com › prettier › prettier-vscode › issues › 1579
Format XML · Issue #1579 · prettier/prettier-vscode
September 29, 2020 - I wonder, Prettier formats xml but not natively xml? Weird, but ok. It's slightly different. Anyway, it would be great if the prettier-vscode extension supports formatting xml. The "XML Tools" extension also formats XML. But really ugly. I like the behavior of Prettier for HTML.
Published   Sep 29, 2020
🌐
JSON Formatter
jsonformatter.org › xml-formatter
Best XML Formatter and XML Beautifier
Online XML Formatter will format xml data, helps to validate, and works as XML Converter. Save and Share XML.
Find elsewhere
🌐
Prettier
prettier.io › docs › plugins
Plugins · Prettier
@prettier/plugin-xml · prettier-plugin-apex by @dangmai · prettier-plugin-astro by @withastro contributors · prettier-plugin-bigcommerce-stencil by @phoenix128 · prettier-plugin-elm by @giCentre · prettier-plugin-erb by @adamzapasnik · prettier-plugin-gherkin by @mapado ·
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Pretty XML - Visual Studio Marketplace
Extension for Visual Studio Code - XML formatter extension for Visual Studio Code. Formats XML documents just like Visual Studio.
🌐
Google Groups
groups.google.com › g › bbedit › c › Uu3d0Q6tnuM
XML Pretty Print
You should have a program called xmllint in your /usr/bin/ directory that can parse and reformat an xml file, stream or URL. Since it can process standard input and output to standard out, it can be used in a text filter. See the user manual and http://bbeditextras.org/wiki/index.php?title...
🌐
Code Beautify
codebeautify.org › xml-pretty-print
XML Pretty Print
This tool allows loading the XML URL to minify. Use your XML REST URL to Pretty XML and Print XML.
🌐
npm
npmjs.com › package › @prettier › plugin-xml › v › 0.10.0
@prettier/plugin-xml - npm
@prettier/plugin-xml is a prettier plugin for XML. prettier is an opinionated code formatter that supports multiple languages and integrates with most editors.
      » npm install @prettier/plugin-xml
    
Published   Jul 08, 2025
Version   0.10.0
Author   Kevin Deisz
🌐
Stack Overflow
stackoverflow.com › questions › 78267751 › how-can-i-prettify-syntax-hilight-xml-in-the-browser-using-prettier
How can I prettify/syntax-hilight xml in the browser using prettier?
<script src="https://unpkg.com/[email protected]/standalone.js"></script> <script src="https://unpkg.com/[email protected]/plugins/graphql.js"></script> <script> (async () => { const formatted = await prettier.format("type Query { hello: String }", { parser: "graphql", plugins: prettierPlugins, }); })(); </script> I am trying to do the same for xml, but from the corresponding cdn page, https://unpkg.com/[email protected]/plugins/ I do not know which plugin I should use.
🌐
Liquid Technologies
liquid-technologies.com › online-xml-formatter
Free Online XML Formatter
Formats an XML document indenting it to make it more readable, a process sometimes referred to as 'beautify' or 'prettify'
🌐
FreeFormatter
freeformatter.com › xml-formatter.html
Free Online XML Formatter - FreeFormatter.com
This free online XML formatter and lets you chose your indentation level and also lets you export to file
Top answer
1 of 13
1240

xmllint from libxml2

xmllint --format file.xml

(On Debian-based distributions, install the libxml2-utils package.)

xml_pp from the XML::Twig perl module

xml_pp < file.xml

(On Debian-based distributions, install the xml-twig-tools package.)

XMLStarlet

xmlstarlet format --indent-tab file.xml

Tidy

tidy -xml -i -q file.xml

Python's xml.dom.minidom

echo '<root><foo a="b">lorem</foo><bar value="ipsum" /></root>' |
  python -c 'import sys, xml.dom.minidom; print(xml.dom.minidom.parseString(sys.stdin.read()).toprettyxml())'

saxon-lint (my own project)

saxon-lint --indent --xpath '/' file.xml

saxon-HE

echo '<root><foo a="b">lorem</foo><bar value="ipsum" /></root>' |
  java -cp /usr/share/java/saxon/saxon9he.jar net.sf.saxon.Query \
       -s:- -qs:/ '!indent=yes'

xidel

xidel --output-node-format=xml --output-node-indent -se . -s file.xml

(Credit to Reino)

Output for all commands:

<root>
  <foo a="b">lorem</foo>
  <bar value="ipsum"/>
</root>
2 of 13
195

xmllint --format yourxmlfile.xml

xmllint is a command line XML tool and is included in libxml2 (http://xmlsoft.org/).

================================================

Note: If you don't have libxml2 installed you can install it by doing the following:

CentOS

cd /tmp
wget ftp://xmlsoft.org/libxml2/libxml2-2.8.0.tar.gz
tar xzf libxml2-2.8.0.tar.gz
cd libxml2-2.8.0/
./configure
make
sudo make install
cd

Ubuntu

sudo apt-get install libxml2-utils

Cygwin

apt-cyg install libxml2

macOS

To install this on macOS with Homebrew just do: brew install libxml2

Git

Also available on Git if you want the code: git clone git://git.gnome.org/libxml2

🌐
npm
npmjs.com › package › xml-formatter
xml-formatter - npm
Converts a XML string into a human readable format (pretty print) while respecting the xml:space attribute. Latest version: 3.6.7, last published: 6 months ago. Start using xml-formatter in your project by running `npm i xml-formatter`. There ...
      » npm install xml-formatter
    
Published   Sep 18, 2025
Version   3.6.7
Author   Chris Bottin