The stock market has traded near record-high levels for months now, and cautious investors are starting to get nervous about how much further stocks can climb without a substantial correction.

One indicator that has gotten increasing amounts of attention is the level of outstanding margin debt, which has hit new nominal highs. Even after adjusting for inflation, margin debt is approaching peaks last seen at previous times of what turned out to be unsustainable market froth, including the tech bubble and the housing boom.

But one thing many people don't realize is that the market for margin debt has gotten a lot more competitive in recent years. Now, used prudently, margin debt can be the cheapest financing option you have -- if you're smart about shopping around.

Margin debt competition
Historically, margin debt was a pricey way to borrow. Brokers set interest rates that were well above what you could get on other types of loans, especially relatively low-rate debt such as mortgage loans.

Even though the overall low-interest environment has helped to push down margin-loan rates, given that most brokers tie what they charge on margin loans to short-term interest rates, small investors still face fairly high financing costs at most institutions. Fidelity, for instance, charges more than 8.5% for loans of less than $10,000, while TD AMERITRADE (NYSE: AMTD) charges 9% and E*TRADE Financial (NASDAQ: ETFC) weighs in at 8.44%, and Schwab (NYSE: SCHW) charges 8.5% for loans under $25,000.

But some of those rates start coming down when you borrow larger amounts. At Fidelity, loans of $500,000 or more have a rate of just 3.75%, which is competitive with mortgage loans at current rates. E*TRADE offers a 3.89% rate for loans of $1 million.

Better rates for small investors
Even better for borrowers, some brokers have specialized in offering rock-bottom financing rates even for small loans. In particular, Interactive Brokers (NASDAQ: IBKR) has rates of less than 1.6% on loans of $100,000 or less, while offering lower rates to bigger borrowers, including a current 0.5% rate to borrowers with loans over $3 million.

Other niche brokers aren't generally quite as aggressive with their margin-loan offerings, but some offer rates in the 3% to 4% range for small loans. As a way for little-known brokers to appeal to potential customers, low margin rates are a cheap but effective way to entice certain investors, including many who use margin as part of trading strategies that can produce above-average revenue for the brokers that serve them.

Is margin the smartest way to borrow?
At such low rates, margin loans become tempting not as a way to buy more stocks but rather as a way to finance other needs. Given that in some cases, margin loan financing costs are deductible as investment interest, the tax benefits are icing on the cake in combination with highly attractive rates.

But margin loans come with two dangerous characteristics. Margin rates are variable, and so if the Fed follows through on its warnings and eventually starts lifting short-term rates, then margin loans will automatically get more expensive. Unlike with fixed mortgage loans, there's no way to lock in current low rates on margin debt.

Also, margin loans are subject to limits in comparison to the value of your stock portfolio. So if the markets plunge and you've overextended yourself by taking out margin debt, you could find yourself having to sell off stocks to repay those loans at exactly the worst time.

Nevertheless, if you keep margin debt at modest levels compared to the value of your portfolio, then it can be the most prudent financing option you have. Given the possibility that some of the climb in margin-debt levels comes from smart investors taking advantage of low rates, it doesn't make as much sense to panic about the possible impact of margin debt as it might have made in the past.

Even if they might make sense for cheap financing, margin loans aren't an essential element of a successful investing strategy. To get pointers on what does make a smart strategy for your portfolio, take a look at our brand-new special report, "Your Essential Guide to Start Investing Today," The Motley Fool's personal finance experts show you why investing is so important and what you need to do to get started the right way. Click here to get your copy today -- it's absolutely free.

Tune in every Monday and Wednesday for Dan's columns on retirement, investing, and personal finance. You can follow him on Twitter @DanCaplinger.

Fool contributor Dan Caplinger has no position in any stocks mentioned. The Motley Fool recommends Interactive Brokers and TD AMERITRADE. The Motley Fool owns shares of TD AMERITRADE. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.