Moscati was the seventh of nine children born to a noble Beneventene family which came from the village of Santa Lucia in Serino, near Avellino. His father, Francesco, was well known as a lawyer and magistrate in the area; his mother, Rosa De Luca dei Marchesi di Roseto, was of noble birth.
Moscati was born in Benevento in 1880; to commemorate his ties to the area, a marble statue has since been erected in the chapel of the Holy Sacrament in Benevento's cathedral. He was baptized six days after his birth, and took his first Communion at eight years old. Moscati moved with his family to Naples in 1884, and would spend much of the rest of his life in the city. During this time his family would spend its summers in Avellino, and Giuseppe would see his father serve at the altar in the local chapel of the Poor Clares whenever they attended Mass.
At the age of ten, he was confirmed into the Church, at which time his family met Bartolo Longo and spent some time in the household of Caterina Volpicelli. The latter was to become among his most important spiritual guides later in life.
After finishing his elementary schooling in 1889, Moscati entered into the Liceo Vittorio Emanuele II in Naples, where among his professors was vulcanologist Giuseppe Mercalli. In 1892 his brother, Alberto, received incurable head trauma in a fall from a horse during his military service. Observing the care which Alberto received at home inspired in Giuseppe an interest in medicine, which he pursued after graduating from the Liceo in 1897; it was in the same year that his father died. Moscati received his doctorate from the Faculty of Medicine at the University of Naples in 1903. The subject of his thesis was hepatic urogenesis.
Immediately upon receiving his degree, Moscati joined the staff of the Ospedale degli Incurabili, eventually becoming an administrator. During this time he continued to study, conducting medical research when not performing his duties at the hospital. Already recognized for his commitment to his duties, he won further recognition for his actions in the aftermath of the eruption of Mount Vesuvius on April 8, 1906. One of the hospitals for which Moscati was responsible, at Torre del Greco, was located a few miles from the volcano's crater. Many of its patients were elderly, and many were paralytics as well. Moscati oversaw the evacuation of the building, getting them all out just before the roof collapsed due to the ash. He sent a letter to the general director of the Neapolitan hospital service, insisting on thanking those who had helped in the evacuation, yet not mentioning his own name.
When cholera broke out in Naples in 1911, Moscati was charged by the civic government with performing public health inspections, and with researching both the origins of the disease and the best ways to eradicate it. This he did quickly, presenting his suggestions to city officials. To his satisfaction, most of these ideas were put into practice by the time of his death. Also in 1911, Moscati became a member of the Royal Academy of Surgical Medicine, and received his doctorate in physiological chemistry.
Besides his work as a researcher and as a doctor, Moscati was responsible for overseeing the directions of the local Institute of Anatomical Pathology. In the institute's autopsy room, he placed a crucifix inscribed with Chapter 13, verse 14 of the Book of Hosea, Ero mors tua, o mors (O death, I will be thy death). The doctor's mother died of diabetes in 1914; as a consequence, Moscati became one of the first Neapolitan doctors to experiment with insulin in his treatment of the disease.
During World War I, Moscati tried to enroll in the armed forces, but was rejected; military authorities felt that he could better serve the country by treating the wounded. His hospital was taken over by the military, and he himself visited close to 3,000 soldiers. In 1919, he was made director of one of the local men's schools; he also continued to teach. In 1922 Moscati was given a libera docenza in clinical medicine, which allowed him to teach at institutes of higher education.
Moscati died in the afternoon of April 12, 1927. He had attended Mass that morning, receiving Communion as he always did, and spent the remainder of the morning at the hospital. Upon returning home he busied himself with patients until around three, after which, feeling tired, he sat down in an armchair in his office; soon after this, he died.
Moscati's body was initially buried in the cemetery of Poggio Reale, but three years later was exhumed and reinterred in the church of Gesù Nuovo. Today a marble stone marks his grave.
Moscati remained true to his faith his entire life, taking a vow of chastity and practicing charity in his daily work. He viewed his practice of medical science as a way of alleviating suffering, not as a way of making profits, and would retire regularly for prayer. He also attended Mass daily, and would sometimes use a patient's faith, as well as the sacraments, in his treatments. Moscati also refused to charge the poor for their treatment, and was known to sometimes send a patient home with a prescription and a 50-lira note in an envelope.
It was claimed even before his death that Moscati was a miracle-worker; some said that he could accurately diagnose and prescribe for any patient merely by hearing a list of his symptoms, and that he was responsible for impossible cures. Reports of his good works continued well after his death, with further reports that he interceded in impossible cases. Consequently, he was beatified by Pope Paul VI on behalf of the Roman Catholic Church on November 16, 1975. Moscati was canonized on October 25, 1987, by Pope John Paul II. His canonization miracle involved the case of a young ironworker dying of leukemia. The young man's mother dreamed of a doctor wearing a white coat, whom she identified as Moscati when shown a photograph. Not long after this, her son went into remission and returned to work.
Moscati was the first modern doctor to be canonized; his feast day is November 16.
In 2007, Italy's Rai Uno presented the TV film St. Giuseppe Moscati: Doctor to the Poor directed by Giacomo Campiotti. The film is based on testimonies of contemporaries of Moscati who knew him, and describes his life between his university graduation in 1903 and his death in 1927.