The probe comes after Valisure, an online pharmacy company, said it alerted the FDA that it found NDMA in Zantac.
The FDA said it has been investigating the carcinogen, called N-nitrosodimethylamine or NDMA, in blood pressure and heart failure medicines since last year and is evaluating whether low levels pose a risk to patients.
"The FDA is not calling for individuals to stop taking ranitidine at this time; however, patients taking prescription ranitidine who wish to discontinue use should talk to their health care professional about other treatment options," the FDA said in the statement.
Ranitidine medicines are used to treat stomach acidity and heartburn and are both over-the-counter and prescription drugs.
"Sanofi takes patient safety seriously, and we are committed to working with the FDA," Sanofi told CNBC in a written statement. The Zantac over-the-counter medication "has been around for over a decade and meets all the specified safety requirements for use in the OTC market."
The FDA said that although NDMA may cause harm in large amounts, the levels it is finding from preliminary tests aren't much higher than what's found in common foods.
Valisure filed a petition with the FDA asking it to recall and suspend sales of ranitidine.
"Every manufacturer and every type of Zantac or ranitidine that we've analyzed seems to have the same problem of the drug itself being very unstable and degrading, or even potentially reacting to, the condition in the human stomach to create NDMA," said David Light, CEO of Valisure.
Light said the pharmacy company analyzes samples of every batch of every medicine it dispenses, and that it adopted analytical techniques recommended by the FDA to screen for NDMA and N-Nitrosodiethylamine or NDEA, another carcinogen.
"We've been trying to be very proactive in terms of not just looking where everyone else is looking," Light said.
Several blood pressure drugs have already been recalled after NDMA was found. Earlier this year, Torrent Pharmaceuticals and Camber Pharmaceutical said they would recall products that contain losartan, which is used to treat high blood pressure, after the substance was detected. Israel-based Teva Pharmaceuticals said it would expand a recall of its heart medication for the same reason.
In June, Valisure told the FDA it found the cancer-causing chemical dimethylformamide in the blood pressure medication valsartan, which was produced by Swiss drugmaker Novartis and other pharmaceutical companies.
Shares of Sanofi dipped on the news before rebounding. They were about flat in mid-morning trading.