According to EducationData.org, the average cost to attend a private college or university in the U.S. now stands at more than $50,000 per year, with about $37,200 of the total going toward tuition and fees. Matriculate to a public university outside of your home state and the tuition alone will still run to an average of $27,437. Those who stick closer to home and pick an in-state public institution will see somewhat more manageable tuition bills that average $9,580 a year.

Any way you slice it, though, higher education is an expensive prospect. EducationData.org estimates that between the actual bills, the interest on student loans, and the income lost from not working for a paycheck while you're working toward your degree, the true cost of a four-year degree can top $400,000.

Covering that can mean carrying a mountain of debt after the fact, or doing a whole lot of saving before you or your child starts. And a savings account isn't going to cut it. Most people will have to invest in the stock market to build up a nest egg big enough to fund four years of college tuition, even at an in-state school.

An all-purpose investment solution like the SPDR S&P 500 ETF Trust (SPY -0.10%) feels like a good option for investing toward this end, and truth be told, it could certainly do the job. But there's arguably a better option for this time-constrained goal. If you're looking to build a meaningful college fund in just 18 years, consider a mid-cap fund like the iShares Core S&P Mid-Cap ETF (IJH -0.96%).

Think small(er)

The appeal of index funds or ETFs as investment vehicles is clear enough. A majority of actively managed funds underperform the benchmark S&P 500 (^GSPC -0.07%) over any given time frame. Many retail investors attempting to pick stocks on their own also fail to match or beat the broad market indices for the same reason -- stock-picking is a tricky business.

The S&P 500 large-cap index isn't the only index there is, however. The S&P 400 Mid Cap Index covers a completely different set of stocks.

A glass jar used to accumulate college-savings.

Image source: Getty Images.

Mid caps -- usually companies with market capitalizations of between $2 billion and $10 billion -- tend to have established customer and revenue bases, and many are just moving into their best-growth years. Investors who pick such stocks are plugging into companies during a high-growth phase of their existences.

Broadly speaking, their performance certainly suggests this is the case. The S&P MidCap 400 has outperformed the S&P 500 by an average of about 2 percentage points per year going all the way back to 1994. That's not a lot of "alpha" for any single year. But little things become much bigger things when growth has time to become cumulative over the course of years. Over that 27-year span, the S&P 500 is up by around 800%, while the S&P MidCap 400 is higher to the tune of nearly 1400%.

^MID Chart

^MID data by YCharts

Clearly, that's a disparity worth taking advantage of.

Crunching the numbers

Most parents don't have 27 years to save up for a child's college education, of course. A more realistic time frame is about 18 years, assuming someone starts a college fund right when the future scholar is born.

Even then, though, the slightly greater volatility of mid caps is worth it.

For perspective, let's compare two hypothetical investment portfolios: one that only invests via a fund like the iShares Core S&P Mid-Cap ETF, while the other regularly puts money into the SPDR S&P 500 ETF Trust. Assuming the S&P MidCap 400 maintains its average annualized gain of 11.8% over the next 18 years, steady investments of $500 a month would -- at the end of that period -- result in a stash worth roughly $370,000. Investing the same amount of money at the same pace in the S&P 500 index that averages a lesser return of 10.7% would only give you around $326,000. That's a nice start, but it might not cover all your college costs if you're looking at out-of-state private colleges.

Or, one could look at it from a different angle. If you're lucky enough to have a significant quantity of extra cash on hand right now that you can dedicate toward your offspring's future education, a one-shot investment of $45,000 in the mid-cap index right now would -- again, assuming the historic growth rates persist -- grow into $370,000 18 years from now. To get a $370,000 college fund 18 years from now using nothing but the S&P 500 index, you'd need to start out with about $55,000 today.

Both calculations demonstrate the power of compound growth and the importance of time in investing.

Get started today

The same broad market risks that apply to building a retirement nest egg also apply to building a college fund. Namely, dipping into a college fund during a downturn or bear market effectively means you're locking in losses that might be unwound a year or two into the future. Parents should plan accordingly, and pare back your exposure-based risk as your child's college start date approaches. Or, if Wall Street hits a rough patch at the worst possible moment, maybe delaying college might be an option. You can even continue adding to their college account while your student waits out the market correction.

Of course, the calculations above are more for providing perspective -- they're certainly not necessarily a hard-and-fast plan an investor should attempt to adhere to. Every family needs to personalize their college-savings strategy and devise the best one they can come up with for their particular situation.

But given the fact that you'll probably have much less time to grow a college fund than a retirement fund, for this purpose, index investing fans would be wise to consider indexes other than the most obvious one.