Do public colleges offer the best return on investment?

It's no secret that the price tag for a degree at a private university is a lot higher than one from a public university. The average cost of tuition and fees alone is more than triple that at a public four-year university.

Now a new analysis finds that gap will grow even wider over the next decade, and that could diminish the return on investment considerably for students at many pricier private institutions.

By 2025, the 20-year net ROI of a bachelor's degree at a private school will rise 4 percent, but the 20-year net ROI of a degree at a public school will rise 17 percent, according to a new PayScale analysis. As a result, the compensation information company projects that the median college return on investment from public colleges will actually exceed the median ROI at private colleges by 24 percent a decade from now.

(Above infographic courtesy of PayScale.)

PayScale calculated the ROI based on a salary survey of about 2.8 million people. The company has enough salary data from alumni of more than 1,000 private and public colleges to be statistically significant, said Katie Bardaro, PayScale's lead economist and analytics manager. "The larger the school, the more data we have on it," Bardaro said.

To determine net ROI, PayScale used the difference between the earnings of public and private college graduates and high school graduates less the total anticipated cost of obtaining a college degree, using college cost data from the Department of Education's Integrated Postsecondary Education Data System (IPEDS) for schools included in its analysis.

Read MoreWhy college costs are so high and rising

For the schools in PayScale's College ROI Report, the average four-year cost for an in-state 2014 public school graduate was $29,609. For a private school graduate, the average four-year cost was $83,192. (Those numbers are considerably smaller than the figures published by the College Board, which estimates 2014 graduates from a private non-profit private university paid nearly $42,000 on average for the 2013-14 year alone, while those at a 4-year public paid nearly $19,000 for the year.)

While salary and tuition projections may vary, there's no question that the tuition gap is growing between public and private universities. And examining the return on investment is an important factor when determining what type of school to attend, Bardaro said.

Read MoreWhich colleges have the best return on investment?

Indeed, rising college costs and stagnating wages have changed the way many parents approach picking a school. The traditional advice on college education used to be go to the best school you can get into, said Mark Schneider, president of College Measures, an education research firm, and a vice president at American Institutes for Research. But that's changing. "Going to a no-name private school that is $40,000 a year is just not worth it," he said.

The diminished ROI of private institutions compared with public colleges will mean that many private schools "will bite the dust," he said, though the "top 100 name-brand" private colleges -- including those in the Ivy League -- should continue to thrive because their reputation and alumni network make the degree valuable.

Read MoreWhat's the value of a college education? It depends

Of course, the school a student attends isn't the only factor in determining potential earnings. The major a student pursues makes a big difference.

"It is not where you go, but what you learn that determines what you make after graduation," said Anthony Carnevale, director of the Georgetown University Center on Education and the Workforce. For example, degrees in science, technology, engineering and mathematics (the so-called STEM fields) will likely produce better earnings outcomes than those in humanities.

The ROI differences between private college and public college are dwarfed by the ROI differences among college degrees, he added. College graduates earn $1 million more than high school graduates on average, according to a recent report by Carnevale and his team, but the highest-paying majors earn $3.4 million more than the lowest-paying majors.