View Microsoft Office Files in the Browser without Downloading

Office Web Apps Viewer and Google Drive Viewer can come handy when you don't have any Office suite installed on your computer or when you would like to quickly preview any online Office file in the browser without having to download it locally.

You can use the filetype: operator in Google to search for Office files of specific types. For instance, a query like invoice template filetype:xls will find public Excel spreadsheets that match the search query. Similarly, you can find Word documents and PowerPoint presentations on the Internet by appending filetype:doc or filetype:ppt to the search query.

How do you view a file that you found on the Internet in the browser itself?

All modern browsers have built-in support for PDF files so you can view them directly in the browser without downloading the file to your computer. However, if you are working with Office files, you can use simple URL hacks to view the file inside Google Docs or Microsoft Office Viewer.

View Office Files in Browser

We’ve two sample files, an Excel spreadsheet and a Word file, hosted on the Internet. The file URLs are provided below and the requirement is to view these files directly in the browser.

https://www.labnol.org/files/word.docx [Word document]
https://www.labnol.org/files/excel.xlsx [Excel spreadsheet]

Google Drive Viewer

Google Drive includes a built-in viewer feature that allows you to view Office files directly in the browser without downloading them. The files are streamed from the hosting website and not uploaded to your Google Drive either.

To view the file, replace FILE_URL with the link of the file you want to view (see example)

https://drive.google.com/viewer?url=FILE_URL

If you would like to embed an Office file in your website with the Google Drive viewer, the HTMl would be as below. You would need to replace the actual URL of the document and may also adjust the height and width attributes of the IFRAME tag.

<iframe
  src="https://drive.google.com/viewer?embedded=true&hl=en-US&url=FILE_URL"
  width="500px"
  height="350px"
  frameborder="0"
></iframe>

Microsoft Office Viewer

Similar to Google Drive Viewer, Microsoft Office also offers a online document viewer to help you to view Word documents, Excel Spreadsheets and PowerPoint decks directly in the browser without downloading them.

Simply replace FILE_URL with the URL of the Office file. (see example)

https://view.officeapps.live.com/op/view.aspx?src=FILE_URL

In addition to previewing Office files, the Office Web Apps Viewer tool can also be used for embedding Microsoft Office documents into your website or blog. The embed code would be something like this:

<iframe
  src="https://view.officeapps.live.com/op/embed.aspx?src=FILE_URL"
  width="500px"
  height="350px"
  frameborder="0"
></iframe>

While Office Web Apps viewer is definitely a better option that Google Docs Viewer, a limitation is that it only works with Office Files, Google Drive Viewer can also handle PDFs, Photoshop files and even AutoCAD drawings.

Amit Agarwal

Amit Agarwal

Google Developer Expert, Google Cloud Champion

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India.

Amit has developed several popular Google add-ons including Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

Awards & Titles

Digital Inspiration has won several awards since it's launch in 2004.

Google Developer Expert

Google Developer Expert

Google awarded us the Google Developer Expert award recogizing our work in Google Workspace.

ProductHunt Golden Kitty

ProductHunt Golden Kitty

Our Gmail tool won the Lifehack of the Year award at ProductHunt Golden Kitty Awards in 2017.

Microsoft MVP Alumni

Microsoft MVP Alumni

Microsoft awarded us the Most Valuable Professional (MVP) title for 5 years in a row.

Google Cloud Champion

Google Cloud Champion

Google awarded us the Champion Innovator title recognizing our technical skill and expertise.

Email Newsletter

Sign up for our email newsletter to stay up to date.

We will never send any spam emails. Promise.