How to View XML Files

Download Article Download Article

This wikiHow teaches you how to view an XML file's code. You can do this on any computer by using the built-in text editor, a browser, or an online XML viewer.

Things You Should Know

  • You can view XML files in different ways including using a text editor, like Notepad or TextEdit, a web browser like Safari, Chrome, or Firefox, or an XML viewer.
  • Open your text editor or XML viewer, then open your XML to view it.
  • Drag and drop the XML file to your web browser to view it.
Method 1
Method 1 of 3:

Using a Text Editor

Download Article
  1. Step 1 Find the XML file.
    You can use your computer's "Open With" feature to open the XML file in a text editor, which will allow you to see the XML file's code in plain-text form.
  2. Step 2 Right-click the XML file.
    Doing so will prompt a drop-down menu.
    • On a Mac, click on the XML file, then click File in the upper-left side of the screen.
    Advertisement
  3. Step 3 Select Open with.
    It's near the middle of the drop-down menu. A pop-out menu will appear. [1]
    • On a Mac, you'll find Open With in the File drop-down menu.
    • If you don't see Open with on Windows, click once the XML file to select it, then right-click the file.
  4. Step 4 Select your computer's text editor.
    Click Notepad on Windows, or click TextEdit on a Mac. Doing so will open the XML file's code in the text editor.
  5. Step 5 Review the XML file's code.
    While the XML file's actual formatting (if present) won't display due to being opened in a text editor, you will be able to see the code that was used to create the XML file.
    • If you want to see the XML file's formatting, try using a browser or using an XML viewer.
  6. Advertisement
Method 2
Method 2 of 3:

Using a Browser

Download Article
  1. Step 1 Open your preferred browser.
    Most popular web browsers can display XML files' code, though Microsoft Edge cannot: [2]
    • Google Chrome
    • Firefox
    • Safari
  2. Step 2 Open a new tab.
    Click the "New Tab" button, which is usually to the right of the right-most tab at the top of the window, to do so.
    • In most web browsers, you can also press Ctrl+T (Windows) or Command+T (Mac) to open a new tab.
  3. Step 3 Drag the XML file into your browser.
    Open the XML file's location, then click and drag the file onto the browser window and drop the file there.
  4. Step 4 Review the results.
    Dragging and dropping your XML file into the browser will prompt the browser to display the XML file's code in a "tree" view.
    • You can click the + or - (or, if you're using Chrome, the triangle) to the left of a main tag in the XML code to minimize or expand the code.
  5. Advertisement
Method 3
Method 3 of 3:

Using an XML Viewer

Download Article
  1. Step 1 Open the XML Viewer website.
    Go to https://codebeautify.org/xmlviewer in your computer's web browser. This viewer allows you to upload an XML file to view its code, as well as choose different viewing formats.
  2. Step 2 Click Browse.
    You'll find this button near the top of the window. Doing so opens a File Explorer (Windows) or Finder (Mac) window.
  3. Step 3 Select your XML file.
    Go to the location of your XML file, then click the XML file once to select it.
  4. Step 4 Click Open.
    This option is in the bottom-right corner of the window. Your XML file will be uploaded to the viewer, and its code will be displayed on the left side of the page.
  5. Step 5 Click Format.
    It's a button in the middle of the window. Doing so will cause your XML file's text to display in color-coded format in the "Result" window on the right side of the page.
    • Sections of XML which are the same (non-black) color correspond to each other. For example, green text refers to tags.
  6. Step 6 Use the file's "Tree" view.
    Clicking the green Tree button in the middle of the page will format the "Result" window, making the code easier to read.
    • You can click each of the headings in the "Tree View Result" window to minimize or expand them.
  7. Advertisement

Community Q&A

Search
Add New Question
  • Question
    How can I display an XML file as a database?
    Community Answer
    Community Answer
    You need a program that "parses" the data into the database. MySQL (MariaDB) has a method called ''LOAD XML''.
  • Question
    How are XML programs understood by a web browser?
    Community Answer
    Community Answer
    The same way it interprets the HTML, CSS, Javascript, etc. languages. Web browsers are designed to translate the plain text information into graphics.
  • Question
    How can I open an XML file on a mobile phone?
    Community Answer
    Community Answer
    You open it the same way you would open HTML files. The browser interprets it without problems.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Video

Tips

  • On a Windows computer, you can also use Notepad++ to view an XML file's information in color-coded format.
    Thanks
    Helpful 1 Not Helpful 0
Submit a Tip
All tip submissions are carefully reviewed before being published
Submit
Thanks for submitting a tip for review!
Advertisement

Warnings

  • XML files often don't have specific formatting assigned to them, so you may end up looking at a jumble of coding language instead of a clear page.
    Thanks
    Helpful 0 Not Helpful 0
Advertisement

You Might Also Like

Open XMLOpen XML
Use Winrar to Fix Corrupted RAR and ZIP ArchivesUse Winrar to Fix Corrupted RAR and ZIP Archives
Open BIN FilesOpen BIN Files
Extract a Gz FileHow to Extract a GZ File on Windows, Linux, Mac, & Mobile
Scan Documents4 Simple Ways to Scan and Save Documents
Open DLL FilesOpen DLL Files
3 Quick Ways to Convert a DOC or DOCX File to a JPEG
Install APK Files on AndroidInstall APK Files on Android
Compress Large FilesCompress Large Files
Open a DAT FileOpen a DAT File
Insert a Multiple Page PDF Into a Word DocumentInsert a Multiple Page PDF Into a Word Document
Transfer Files to SD Card on AndroidHow to Transfer Files to an SD Card on Android
Protect Folders With Passwords3 Easy Ways to Protect a Folder With a Password
Open TMP FilesOpen TMP Files
Advertisement

References

  1. https://www.freecodecamp.org/news/how-to-open-an-xml-file/
  2. https://pds.nasa.gov/datastandards/training/documents/How%20to%20View%20an%20XML%20File.pdf

About This Article

Luigi Oppido
Written by:
Luigi Oppido
Computer & Tech Specialist
This article was written by Luigi Oppido and by wikiHow staff writer, Jack Lloyd. Luigi Oppido is the Owner and Operator of Pleasure Point Computers in Santa Cruz, California. Luigi has over 25 years of experience in general computer repair, data recovery, virus removal, and upgrades. He is also the host of the Computer Man Show! broadcasted on KSQD covering central California for over two years. This article has been viewed 1,021,574 times.
How helpful is this?
Co-authors: 12
Updated: May 21, 2024
Views: 1,021,574
Categories: File Manipulation
Article SummaryX

1. Find and right-click the XML file.
2. Select Open With
3. Click Notepad (Windows) or TextEdit (Mac).
4. Review the XML file's code.

Did this summary help you?

In other languages
  • Print
  • Send fan mail to authors
Thanks to all authors for creating a page that has been read 1,021,574 times.

Is this article up to date?

Advertisement