The first Coca-Cola recipe was invented in Columbus, Georgia, by John Stith Pemberton, originally as a cocawine called Pemberton's French Wine Coca in 1885. He may have been inspired by the formidable success of European Angelo Mariani's cocawine, Vin Mariani.

In 1886, when Atlanta and Fulton County passed Prohibition legislation, Pemberton responded by developing Coca-Cola, essentially a carbonated, non-alcoholic version of French Wine Cola.

The first sales were at Jacob's Pharmacy in Atlanta, Georgia, on May 8, 1886. It was initially sold as a patent medicine for five cents Pemberton claimed Coca-Cola cured many diseases, including a glass at soda fountains, which were popular in the United States at the time due to the belief that carbonated water was good for the health.morphine addiction, dyspepsia, neurasthenia, headache, and impotence. Pemberton ran the first advertisement for the beverage on May 29 of the same year in the Atlanta Journal. For the first eight months only nine drinks were sold each day.

By 1888, three versions of Coca-Cola — sold by three separate businesses — were on the market. Asa Griggs Candler acquired a stake in Pemberton's company in 1887 and incorporated it as the Coca Cola Company in 1888. The same year, while suffering from an ongoing addiction to morphine, Pemberton sold the rights a second time to four more businessmen: J.C. Mayfield, A.O. Murphey, C.O. Mullahy and E.H. Bloodworth. Meanwhile, Pemberton's alcoholic son Charley Pemberton began selling his own version of the product.

In an attempt to clarify the situation, John Pemberton declared that the name Coca-Cola belonged to Charley, but the other two manufacturers could continue to use the formula. So, in the summer of 1888, Candler sold his beverage under the names Yum Yum and Koke. After both failed to catch on, Candler set out to establish a legal claim to Coca-Cola in late 1888, in order to force his two competitors out of the business. Candler purchased exclusive rights to the formula from John Pemberton, Margaret Dozier and Woolfolk Walker. However, in 1914, Dozier came forward to claim her signature on the bill of sale had been forged, and subsequent analysis has indicated John Pemberton's signature was most likely a forgery as well.

In 1892, Candler incorporated a second company, The Coca-Cola Company (the current corporation), and in 1910, Candler had the earliest records of the company burned, further obscuring its legal origins. Regardless, Candler began marketing the product, although the efficacy of his concerted advertising campaign would not be realized until much later. By the time of its 50th anniversary, the drink had reached the status of a national icon for the USA. In 1935, it was certified kosher by Rabbi Tobias Geffen, after the company made minor changes in the sourcing of some ingredients.

Coca-Cola was sold in bottles for the first time on March 12, 1894. Cans of Coke first appeared in 1955. The first bottling of Coca-Cola occurred in Vicksburg, Mississippi, at the Biedenharn Candy Company in 1891. Its proprietor was Joseph A. Biedenharn. The original bottles were Biedenharn bottles, very different from the much later hobble-skirt design that is now so familiar. Asa Candler was tentative about bottling the drink, but the two entrepreneurs who proposed the idea were so persuasive that Candler signed a contract giving them control of the procedure. However, the loosely termed contract proved to be problematic for the company for decades to come. Legal matters were not helped by the decision of the bottlers to subcontract to other companies—in effect, becoming parent bottlers.

Coke concentrate, or Coke syrup, was and is sold separately at pharmacies in small quantities, as an over-the-counter remedy for nausea or mildly upset stomach.