Want to work in a profitable industry? Accounting's your safest best.

Accounting services has the best profit margin of all industries, according to financial information company Sageworks. Based on an analysis of the financial statements of privately held companies, Sageworks ranked all industries by net profit margin over the last 12 months and found that accounting services had a net profit margin averaging 19.8 percent during the 12-month period ending July 31, 2014.

The other industries in the top five are legal services, oil and gas extraction, equipment rental and leasing, and offices of dentists. Seven of the top fifteen industries are related to health care or real estate.

“Many of these industries are consistently at the top of the list because they are profitable by their very nature,” says Sageworks analyst Jenna Weaver, adding that service-based businesses can attain strong profit margins based on their ability to keep costs low, while charging a premium for their specialized services.

“These kinds of businesses sell services from bookkeeping to legal advice to health care and do not need to purchase as many, if any, physical goods,” she says.

Below are the 15 industries with the highest net profit margin during the past 12 months.