Value investing pioneer Benjamin Graham once said that the stock market is a voting machine in the short run but a weighing machine in the long run. Once a company goes public on the stock market and its shares start trading on an exchange, the share price is determined by supply and demand.
Over the long term, share prices are determined by the economics of the business. It's impossible to predict exactly what a stock will do and when, but we can study how share price movement works. Let's unpack Graham's statement a little more and go over how stock prices work.

How prices work
How do stock prices work?
It starts with the initial public offering (IPO). Companies work with investment bankers to set a primary market price when a company goes public. The price is set based on valuation and demand from institutional investors.
After the initial offering, the stock starts to trade on secondary markets -- that is, stock exchanges such as the New York Stock Exchange (NYSE) or the Nasdaq. This is where we get into the market being a voting machine.
For highly traded stocks, there are buyers and sellers on each side constantly bidding and asking for new prices. Institutions trying to build huge positions and even brokerages working for retail investors will bid for stocks. If there are more buyers than sellers, the price will get bid up. If there are more sellers than buyers, the opposite will happen.
That's why Graham called the market a voting machine. On a second-by-second basis, the stock's price reflects what current buyers are willing to pay and what current sellers are willing to take. This might sound familiar if you took economics in college. It's the same principle for any commodity: The price is determined by supply and demand.
Why stock prices change
Why do stock prices change?
If you think about stock prices as an ongoing debate between those interested in buying a stock and those interested in selling a stock, you can think of stock price movement as one of those two sides temporarily getting the upper hand.
When more investors want to buy a stock than sell it, the price tends to increase. But if more investors want to sell than buy, the price tends to decrease.
The shift in preference that drives buying and selling can be influenced by a number of factors, including company-specific news or data, industry trends, economic conditions, and changing investor sentiment.
For example, sometimes the stock will go up if a company has a strong earnings report. But if the company operates in an area that investors believe has limited upside, like a maker of horse carriages at the dawn of the automotive age, a good quarterly report might not be enough to lift a stock price higher.
Bid and Ask
Determining prices
Understanding what determines stock price
Now, let's get to the weighing machine part. Over the long term, stock prices are determined by the earnings power of the business. Remember, a stock is a share of an actual business. The better the business does, the better the stock will do.
Graham's protege, billionaire investor Warren Buffett, says a stock is worth the discounted value of the stream of cash flows it will earn over the life of the business. To determine the valuation of the business, he will estimate the earnings the business will make in the future and then discount the future years because money now is worth more than money you could get later on.
But a stock will often deviate from that valuation. If it trades for less than its value, it is considered undervalued. If it trades for more, it is considered overvalued. Eventually, the stock price reverts to its value as the market weighs the stock price based on the business' earning power. Investors who look to take advantage of deviations by buying undervalued stocks and shorting overvalued stocks are called value investors.
Market cap
How market cap affects price
A stock's market cap is equal to the total shares times the share price. It's the price it would take to buy all of a company's outstanding shares. Many stocks issue more shares to fund the business, so it is important to base valuation on the market cap and not just the stock price. The more shares issued, the less of a fraction of the business you own.
On the other side, if a business buys back shares, the price of each of your shares will need to go up to maintain the same market cap. Share buybacks are generally cheered by shareholders as long as the stock price isn't overvalued.
Is it "cheap?"
How to tell if a stock is "cheap"
We don't have the space here to do a full-blown discounted cash flow analysis as Buffet would like, but we can use a shortcut. The price-earnings ratio (P/E) shows the stock's price relative to earnings. It's calculated by dividing the stock price by earnings per share, which is readily available on most financial websites and the company's quarterly reporting documents.
Let's look at Home Depot (HD 0.05%) as an example. In mid-July 2025, Home Depot was trading at $371 per share, and its earnings per share over the past 12 months were $14.74. That's a P/E of 25.2.
That number doesn't mean much by itself, so we need to compare it to its historical numbers. Over the last 10 years, Home Depot has averaged a P/E of 22.6, which is below the current valuation. Because the P/E average had been lower than the July ratio, Home Depot might not be an attractive stock investment at this moment. Value investors tend to look for stocks with lower P/E ratios.
Keeping up with prices
How to keep up with stock prices
Before the Internet age, investors would have to wait for the morning newspaper for a daily update on the price movement of individual stocks. Today, there are many free online sources for that information, and ample podcasts and other outlets that can help put those moves in perspective. To look up the current price of Home Depot, for example, an investor can simply type "Home Depot price" into a search engine.
Many free websites also offer investors the option of entering their entire portfolios, allowing that investor to see the total value of their holdings and track their progress over time.
Related investing topics
In the short term, a stock's price is vulnerable to the emotional whims of the crowd. But in the long term, smart investors can pinpoint where the crowd's emotions set up opportunity. Focus on the long term in your investing, and don't let other people's emotions affect your investment decisions.
FAQs
FAQs about how stock prices are determined
Who actually changes the stock price?
The quoted stock price is the price of the last trade between a buyer and seller of the stock. So, the investors who buy and sell shares change the stock price during the day.
How do people predict stock prices?
People attempt to predict stock prices by looking at company trends and news, as well as macroeconomic factors -- such as the health of the economy and specific industries -- to determine which direction a stock is headed. Investors should note that every prediction of a future stock price is an educated guess, at best, since there is no way to determine with certainty where a stock is headed.
What is the formula for the price of a stock?
The basic formula for a price of a stock is a company's market capitalization, or its total equity value, divided by its number of shares outstanding. Each individual share of stock represents ownership of a small sliver of a company.
What is the math behind the stock market?
Investors use a lot of complex math to try to determine how stocks should be valued, but at its most basic level, the math of the stock market is how much an investor believes a company should be worth divided by the number of shares a company has issued. If the calculation comes in at a number above the current trading price of a stock, that could be an indication that it is a good time to buy that stock.
What is a good P/E ratio for a stock?
P/E ratio, or price-to-earnings ratio, is a measure of a stock's price relative to its earnings per share. It is a way to figure out how much you are paying for $1 worth of earnings power. P/E ratios vary by industry. For example, the average P/E ratio for a telecom equipment company in mid-2025 was 40.05, but the average figure for an apparel company was 18.53.