A stock exchange is a physical or electronic marketplace where securities, such as stocks, are bought and sold. A stock market, on the other hand, is a broader term that encompasses all the exchanges, brokers, and other entities involved in trading stocks and other securities.