U.S. News & World Report has ranked Massachusetts General Hospital, the Mayo Clinic, Johns Hopkins Hospital and UCLA Medical Center as the top hospitals in the nation in its annual report released Tuesday.

The news and data organization gathered information on nearly 5,000 medical centers in the United States for its yearly report, which is designed to help patients with life-threatening or rare conditions select hospitals based on their specialties. Its formula measured various factors including patient volume, risk-adjusted survival rates and adequacy of nurse staffing.

“Patients deserve high-quality information on hospitals,” Ben Harder, chief of health analysis at U.S. News, said in a news release. “We strive to provide them with the most comprehensive data available so they can make more informed decisions together with their doctor about where to undergo treatment.”

U.S. News featured rankings among 16 specialties to compile its honor roll of outstanding hospitals, as well as a list of 520 Best Regional Hospitals based on performance in complex and common care, and by state and metro area.

This year Massachusetts General Hospital, ranked No. 2 on the 2014-2015 honor roll, earned the No. 1 spot in the 2015-2016 honor roll, which identifies hospitals that ranked well in multiple specialties. Following Mass General in the latest report is The Mayo Clinic, Johns Hopkins Hospital and UCLA Medical Center, which were ranked Nos. 2 and 3 respectively. University of Texas MD Anderson Cancer Center was named best in cancer care, the Cleveland Clinic best in cardiology and heart surgery, and the Hospital for Special Surgery best in orthopedics.

In this year’s rankings 137 U.S. hospitals excelled enough in complex care to earn national rankings in one or more specialties. Fifteen of those hospitals made the honor roll, which required a ranking at or close to the top in six or more specialties.

Triangle Park, N.C.-based research organization RTI International used data to compile the specialty rankings, while U.S. News used those specialty rankings and its own Common Care ratings to name the Best Regional Hospitals.