Money

The 30 colleges where students go on to earn the most money

When it comes to choosing a college, there are a lot of factors to consider: Location, class size, academic majors. But you may want to consider earning potential as well. After all, a college education is now the second-biggest expense you are likely to make in your lifetime.

To round up a list of the schools that produce the highest-earning alumni, CNBC used the U.S. Department of Education's College Scorecard. The tool provides a variety of data on thousands of colleges, including the median earnings of federally aided students 10 years after enrolling and the average annual cost of attending.

For our ranking, we restricted the list to bachelor's degree-granting institutions and excluded special focus institutions.

Scroll down to see the colleges and universities where students go on to earn the most money. We also included the average annual cost of each school, which the U.S. Department of Education defines as "the average annual net price for federal aid recipients, after aid from the school, state, or federal government. For public schools, this is only the average cost for in-state students."

30. Massachusetts Maritime Academy

Average annual cost: $15,785

Median annual earnings 10 years after enrolling: $69,000

Read more about MMA.

Massachusetts Maritime Academy
Source: Massachusetts Maritime Academy
Massachusetts Maritime Academy

29. Bucknell University

Average annual cost: $32,487

Median annual earnings 10 years after enrolling: $69,100

Read more about Bucknell.

Bucknell University
Michael Caruso | Flickr
Bucknell University

28. Illinois Institute of Technology

Average annual cost: $19,667

Median annual earnings 10 years after enrolling: $69,300

Read more about IIT.

Illinois Institute of Technology
Raymond Boyd | Getty Images
Illinois Institute of Technology

27. University of Notre Dame

Average annual cost: $29,368

Median annual earnings 10 years after enrolling: $70,100

Read more about Notre Dame.

Notre Dame University
Michael Hickey | Getty Images
Notre Dame University

26. Cornell University

Average annual cost: $29,240

Median annual earnings 10 years after enrolling: $72,100

Read more about Cornell.

Cornell University.
Kenneth C. Zirkel | Getty Images
Cornell University.

25. Washington and Lee University

Average annual cost: $24,655

Median annual earnings 10 years after enrolling: $72,900

Read more and Washington and Lee.

Students gather in the shade on the campus of Washington and Lee University in Lexington City, Va.
Doug Plummer | Washington and Lee University
Students gather in the shade on the campus of Washington and Lee University in Lexington City, Va.

24. Villanova University

Average annual cost: $35,565

Median annual earnings 10 years after enrolling: $73,900

Read more about Villanova.

Villanova University campus
John Greim | Getty Images
Villanova University campus

23. Yale University

Average annual cost: $20,168

Median annual earnings 10 years after enrolling: $74,200

Read more about Yale.

Yale University
Image source: Michael Marsland | Yale University
Yale University

21. SUNY Maritime College (TIE)

Average annual cost: $18,431

Median annual earnings 10 years after enrolling: $74,500

Read more about SUNY Maritime College.

The north gate of SUNY Maritime College is shown in the Bronx borough of New York.
Jim Henderson | Wikimedia Commons
The north gate of SUNY Maritime College is shown in the Bronx borough of New York.

21. Georgia Institute of Technology (TIE)

Average annual cost: $10,994

Median annual earnings 10 years after enrolling: $74,500

Read more about Georgia Tech.

Georgia Tech
Mike Comer | Getty Images
Georgia Tech

20. Columbia University

Average annual cost: $22,298

Median annual earnings 10 years after enrolling: $75,200

Read more about Columbia.

The campus of Columbia University in New York City
Getty Images
The campus of Columbia University in New York City

19. Colorado School of Mines

Average annual cost: $25,777

Median annual earnings 10 years after enrolling: $75,700

Read more about Colorado School of Mines.

Colorado School of Mines
John Leyba | The Denver Post | Getty Images
Colorado School of Mines

18. Carnegie Mellon University

Average annual cost: $31,634

Median annual earnings 10 years after enrolling: $76,200

Read more about Carnegie Mellon.

Carnegie Mellon University
Pichaya Viwatrujirapong | Getty Images
Carnegie Mellon University

16. Duke University (TIE)

Average annual cost: $25,369

Median annual earnings 10 years after enrolling: $76,700

Read more about Duke.

People walk by Duke Chapel on the campus of Duke University in Durham, North Carolina, U.S.
Jim R. Bounds | Bloomberg | Getty Images
People walk by Duke Chapel on the campus of Duke University in Durham, North Carolina, U.S.

16. Lehigh University (TIE)

Average annual cost: $31,267

Median annual earnings 10 years after enrolling: $76,700

Read more about Lehigh.

Lehigh University
Source: Lehigh University
Lehigh University

15. Bentley University

Average annual cost: $31,616

Median annual earnings 10 years after enrolling: $76,900

Read more about Bentley.

Bentley University
Source: Bentley University
Bentley University

14. Kettering University

Average annual cost: $33,861

Median annual earnings 10 years after enrolling: $77,400

Read more about Kettering.

C.S. Mott Engineering and Science Center on the campus of Kettering University.
Bryan Duggan | Wikipedia
C.S. Mott Engineering and Science Center on the campus of Kettering University.

13. California Institute of Technology

Average annual cost: $25,308

Median annual earnings 10 years after enrolling: $77,800

Read more about Caltech.

California Institute of Technology
Danita Delimont | Getty Images
California Institute of Technology

12. Princeton University

Average annual cost: $7,103

Median annual earnings 10 years after enrolling: $77,900

Read more about Princeton.

Princeton University campus
Source: Princeton University
Princeton University campus

11. Maine Maritime Academy

Average annual cost: $20,861

Median annual earnings 10 years after enrolling: $78,800

Read more about MMA.

Maine Maritime Academy
myLoupe | Universal Images Group | Getty Images
Maine Maritime Academy

10. California Maritime Academy

Average annual cost: $15,472

Median annual earnings 10 years after enrolling: $79,400

Read more about Cal Maritime.

California State University Maritime Academy
Source: California State University Maritime Academy
California State University Maritime Academy

9. Rensselaer Polytechnic Institute

Average annual cost: $33,595

Median annual earnings 10 years after enrolling: $79,600

Read more about RPI.

RPI
Matt H. Wade | Wikipedia
RPI

8. University of Pennsylvania

Average annual cost: $24,370

Median annual earnings 10 years after enrolling: $79,700

Read more about Penn.

University of Pennsylvania
Ann Hermes | The Christian Science Monitor | Getty Images
University of Pennsylvania

7. Worcester Polytechnic Institute

Average annual cost: $35,187

Median annual earnings 10 years after enrolling: $80,300

Read more about WPI.

Worcester Polytechnic Institute
Christian Science Monitor | Getty Images
Worcester Polytechnic Institute

6. United States Merchant Marine Academy

Average annual cost: $5,538

Median annual earnings 10 years after enrolling: $82,000

Read more about USMMA.

Merchant marines walk to class at the United States Merchant Marine Academy in Kings Point, NY, on August 01, 2016.
Yana Paskova | For The Washington Post | Getty Images
Merchant marines walk to class at the United States Merchant Marine Academy in Kings Point, NY, on August 01, 2016.

5. Stevens Institute of Technology

Average annual cost: $28,296

Median annual earnings 10 years after enrolling: $83,700

Read more about Stevens.

Stevens Institute of Technology
Source: Stevens Institute of Technology

4. Georgetown University

Average annual cost: $27,506

Median annual earnings 10 years after enrolling: $84,000

Read more about Georgetown.

Georgetown University campus
Getty Images
Georgetown University campus

3. Stanford University

Average annual cost: $14,559

Median annual earnings 10 years after enrolling: $86,000

Read more about Stanford.

Stanford University Campus.
David Butow | Getty Images
Stanford University Campus.

2. Massachusetts Institute of Technology

Average annual cost: $23,547

Median annual earnings 10 years after enrolling: $89,200

Read more about MIT.

Students walk on the campus of the Massachusetts Institute of Technology.
Yiming Chen | Getty Images
Students walk on the campus of the Massachusetts Institute of Technology.

1. Harvard University

Average annual cost: $14,068

Median annual earnings 10 years after enrolling: $95,500

Read more about Harvard.

The Harry Elkins Widener Memorial Library on the campus of Harvard University in Cambridge, Mass.
Kelvin Ma | Bloomberg | Getty Images
The Harry Elkins Widener Memorial Library on the campus of Harvard University in Cambridge, Mass.