Marshall was born in Kalgoorlie, Western Australia and lived in Kalgoorlie and Carnarvon until moving to Perth at the age of eight. His father held various jobs, and his mother was a nurse. He is the eldest of four siblings. He attended Newman College and the University of Western Australia, where he received a Bachelor of Medicine, Bachelor of Surgery (MBBS) in 1974. He married his wife Adrienne in 1972 and has four children.
In 1979, Marshall was appointed as a Registrar in Medicine at the Royal Perth Hospital. He met Robin Warren, a pathologist interested in gastritis, during internal medicine fellowship training at Royal Perth Hospital in 1981. Together, the pair studied the presence of spiral bacteria in association with gastritis. In 1982, they performed the initial culture of H. pylori and developed their hypothesis related to the bacterial cause of peptic ulcer and gastric cancer. It has been claimed that the H. pylori theory was ridiculed by the establishment scientists and doctors, who did not believe that any bacteria could live in the acidic environment of the stomach. Marshall has been quoted as saying in 1998 that "(e)veryone was against me, but I knew I was right." On the other hand, it has also been argued that medical researchers showed a proper degree of scientific scepticism until the H. pylori hypothesis could be supported by evidence.
After failed attempts to infect piglets in 1984, Marshall, after having a baseline endoscopy done, drank a Petri dish containing cultured H. pylori, expecting to develop, perhaps years later, an ulcer. He was surprised when, only three days later, he developed vague nausea and halitosis (due to the achlorhydria, there was no acid to kill bacteria in the stomach, and their waste products manifested as bad breath), noticed only by his mother. On days 5–8, he developed achlorydric (no acid) vomiting. On day eight, he had a repeat endoscopy, which showed massive inflammation (gastritis), and a biopsy from which H. pylori was cultured, showing it had colonised his stomach. On the fourteenth day after ingestion, a third endoscopy was done, and Marshall began to take antibiotics. Interestingly, Marshall did not develop antibodies to H. pylori, suggesting that innate immunity can sometimes eradicate acute H. pylori infection. Marshall's illness and recovery, based on a culture of organisms extracted from a patient, fulfilled Koch's postulates for H. pylori and gastritis, but not for peptic ulcer. This experiment was published in 1985 in the Medical Journal of Australia and is among the most cited articles from the journal.
After his work at Fremantle Hospital, Marshall did research at Royal Perth Hospital (1985–86) and at the University of Virginia, USA (1986–Present), before returning to Australia while remaining on the faculty of the University of Virginia. He held a Burnet Fellowship at the University of Western Australia (UWA) from 1998–2003. Marshall continues research related to H. pylori and runs the H. pylori Research Laboratory at UWA.
In 2007, Marshall accepted a part-time appointment at the Pennsylvania State University.
In 2005, the Karolinska Institute in Stockholm awarded the Nobel Prize in Physiology or Medicine to Marshall and Robin Warren, his long-time collaborator, "for their discovery of the bacterium Helicobacter pylori and its role in gastritis and peptic ulcer disease".
Marshall also received the Warren Alpert Prize in 1994; the Australian Medical Association Award and the Albert Lasker Award for Clinical Medical Research in 1995; the Gairdner Foundation International Award in 1996; the Paul Ehrlich and Ludwig Darmstaedter Prize in 1997; the Dr A.H. Heineken Prize for Medicine, the Florey Medal, and the Buchanan Medal of the Royal Society in 1998.
He was elected a Fellow of the Royal Society (FRS) in 1999. His certificate of election to the Royal Society reads:
Barry Marshall, together with Robin Warren, discovered spiral bacteria in the stomachs of almost all patients with active chronic gastritis, or duodenal or gastric ulcers, and proposed that the bacteria were an important factor in the aetiology of these diseases. In 1985, Marshall showed by self administration that this bacterium, now called Helicobacter pylori, causes acute gastritis and suggested that chronic colonisation directly leads to peptic ulceration. These resuslts [sic] were a major challenge to the prevailing view that gastric disorders had a physiological basis, rather than being infectious diseases. Marshall showed that antibiotic and bismuth salt regimens that killed H. pylori resulted in the cure of duodenal ulcers. The view that gastric disorders are infectious diseases is now firmly established and there is increasing evidence for a role of H. pylori infection in gastric cancers. The work of Marshall has produced one of the most radical and important changes in medical perception in the last 50 years. Barry Marshall was awarded the Albert Lasker Award for Clinical Science in 1995 and the Buchanan Medal in 1998.
Marshall was awarded the Benjamin Franklin Medal for Life Sciences in 1999; the Keio Medical Science Prize in 2002; and the Australian Centenary Medal and Macfarlane Burnet Medal and Lecture in 2003.
Marshall was appointed a Companion of the Order of Australia in 2007. He was awarded an honorary Doctor of Science degree by the University of Oxford in 2009.