Which colleges have the best return on investment?

A new study examines which colleges offer graduates the best return on investment. Seven out of the top 10 schools specialize in engineering.

The value of a college education can be determined by many intangible factors: knowledge gained, opportunities seized and connections made. So can you really place a price on what you gained during your college years?

Well, PayScale has. The compensation information company ranked hundreds of U.S. colleges and universities on their total cost and alumni earnings. It calculated a 20-year return on investment by estimating what graduates will earn over two decades of work, minus what they would have earned as a high school graduate and the cost of college.

Read More 529 balances are growing, but so are college costs

"With student loan debt over $1 trillion, we are surprised more parents and students aren't taking a closer look at the financial aspects of college education," said Lydia Frank, PayScale's editorial director.

Colleges that specialize in engineering dominated the list. The top three schools overall for college return on investment are Harvey Mudd College, Caltech and Stevens Institute of Technology. When you considered financial assistance to students, Stanford comes in third on the list. You can play with PayScale's ranking here.

Not surprisingly, PayScale found that alums who majored in engineering, computer science and math or who ended up working in business and finance have the best chance of seeing a 20-year return on investment of more than $1 million for their education.

Read More How not to drown in student loan debt

A college education pays dividends, but perhaps not as good as the overall stock market. Only 24 percent of schools included in PayScale's ranking have a 20-year annualized return on investment higher than the S&P 500's annualized 7.8 percent from 1994 to 2014.



More From CNBC