How to Download Historical Data from Yahoo Finance

This page is a detailed guide to finding and downloading historical data such as daily stock prices or index values from Yahoo Finance.

Yahoo Finance Website

Go to Yahoo Finance homepage:

Yahoo Finance homepage

At the moment and on my computer it looks like this. It may look a little different on your device, but the key sections will most likely always be there.

To access historical data, we need to get to the quote page dedicated to the particular security we are looking for. There are several different ways how we can get to that page.

How to Find the Right Symbol on Yahoo Finance

Option 1: If it's one of the popular indices like the S&P500 or the Dow, the fastest way is to click on the particular quote shown below the search bar.

Option 2: If you know the Yahoo symbol, you can enter it in the search bar. If you don't, just enter the company name, index name or some other relevant phrase. Yahoo will suggest things which you are most likely looking for and usually you will find the right security among the first few options.

Yahoo Finance symbol search

Just be careful with stocks – some (especially the most popular ones) are traded on multiple exchanges in different countries. The exchange is shown on the right side of each suggested item.

For instance, if you are looking for Microsoft stock as in the screenshot above, Yahoo will suggest the stock traded on NASDAQ (symbol MSFT, which is the one you are probably looking for), but also other issues traded in places like Frankfurt or Amsterdam. These are often traded in different currencies and the market data will be different from what you need.

Option 3: If you haven't been successful with symbol search, you can try to find the security by clicking Market Data in the main horizontal menu and selecting the particular category.

Yahoo Finance Market Data categories

Option 4 – the fastest if you know the Yahoo symbol:

Type this URL in your browser address bar (or use the link directly):

Replace "MSFT" with the symbol you are looking for.

Preparing the Historical Data

Once you get to the right symbol's main page, it should look like this (we will continue with the Microsoft stock example):

Historical data for the given symbol

Click Historical Data. Just below the main symbol menu there will be a few options to specify what data you want – you can adjust the date range, data type (usually you want Historical Prices, which is set by default) and frequency (you probably want Daily, set by default). Don't forget to click Apply if you've made any changes.

Then click Download Data, which is highlighted in the following screenshot:

Customizing and downloading historical data

The website will offer a CSV file, usually named table.csv, which you can either save to your computer or immediately open.

Yahoo Finance historical data output

For some symbols, the Download Data link is missing and the CSV file is unavailable. This is most likely caused by licensing terms between Yahoo and the particular stock exchange or index provider.

Unfortunately this currently (2023) applies to some of the most popular stock indices, including S&P500 (^GSPC) and the Dow Jones Industrial Average (^DJI).

Individual US stocks are working, as well as stocks from other major markets, including the UK, France, Germany, Japan, or China.

If you can't see the Download Data link in the top right corner of the historical data table, you can still select the data (including the header row) in the browser and copy-paste it into a blank Excel file. This is not the most elegant way to get historical data, but at least an acceptable workaround if you only need one symbol which happens to be unavailable.

Yahoo Finance Historical Data Format

When you open the CSV in Excel, you can see the data format, which is usually Date, Open, High, Low, Close, Volume, and Adjusted Close if applicable.

Yahoo Finance historical data format

Floating Point Imprecision

One thing that may be surprising is that the prices (open, high, low, close) sometimes have 6 decimal places. For instance, when the stock closed at 249.18 the data can actually show 249.179993.

This is due to the way computers, only understanding zeros and ones, handle decimal numbers (this issue is known as floating point imprecision in computer science). It appears Yahoo does not correct it before presenting the data to the outside world.

For most research purposes this imprecision is immaterial (it only affects the sixth decimal place), but you may still want to correct it using Excel ROUND function.

Adjusted Close vs. Close

Adjusted Close is the Close adjusted for dividends, stock splits, and other corporate actions.

For some purposes (such as historical volatility calculation) it is more useful than Close, for others Close is more appropriate.

For most indices and securities which don't pay dividends, Adjusted Close is the same as Close.

Volume Accuracy and Interpretation

Stock trading volume can be inaccurate. For some indices, Volume shows complete nonsense (indices themselves don't have trading volume; the number shown can be the total trading volume of all index components or entire stock exchange, or whatever Yahoo thinks fits there).

Adjusting the Data to Your Needs

The data as provided by Yahoo Finance is sorted from newest to oldest. You will often want it sorted the other way, which is easy to do in Excel. Select all the cells with data and then in Excel main menu choose Data and in the lower menu click Sort.

Sorting data in Excel

The Sort dialog window will appear, where you can choose to sort the data by Date, Oldest to Newest. Make sure to have the "My data has headers" option checked if you have selected the cells including the first header row.

Sorting data in Excel

Besides sorting the data, you can also delete any columns which you don't need, such as Volume and Adjusted Close.

Saving the CSV as XLSX

If you primarily do your data analysis in Excel, it is useful to save the file as a standard Excel workbook (xlsx) rather than CSV, because there is not so much you can do (and save) with a CSV in Excel.

Saving file as Excel workbook

Now you have the data ready for further work.

Yahoo Finance Alternatives for Historical Data

Yahoo Finance has been the most popular source of free historical data for a long time. However, the discontinuation of Yahoo Finance free API and other restrictions in the recent years has made many people look for alternatives. One of the best and fast growing free source is Alpha Vantage, which can be used with Excel, Python, and a number of other programming languages. See my Alpha Vantage tutorial at FinTut.

By remaining on this website or using its content, you confirm that you have read and agree with the Terms of Use Agreement.

We are not liable for any damages resulting from using this website. Any information may be inaccurate or incomplete. See full Limitation of Liability.

Content may include affiliate links, which means we may earn commission if you buy on the linked website. See full Affiliate and Referral Disclosure.

We use cookies and similar technology to improve user experience and analyze traffic. See full Cookie Policy.

See also Privacy Policy on how we collect and handle user data.

© 2024 Macroption