Coveting a shiny new iPhone, but don't want to shell out the cash? If you have an older model, you may be able to get enough cash or store credit for it to cover the cost of an upgrade.

By selling my old iPhone on eBay, I've been able to score a new phone nearly every upgrade cycle for free -- and often made enough extra money to buy a shiny new case as well. (Yes, I had to re-up my carrier contract, and you will, too, to get the best deal on the new phone.)

The beauty of this little swap game is that you don't even need a newer iPhone to make it work for you.

What you can get for your old phones
To show you what kind of cash is waiting for your old phones, I shopped around a 16GB iPhone 5, my 16GB iPhone 4S, and my editor's old 16GB iPhone 4 and 16 GB iPhone 3G to see who's offering the best prices.

(The following prices assume the phone is in good condition, with normal signs of wear. I also assumed that the phone was not factory unlocked. These phones are generally worth a lot more, but they are much less common.)

Get cash
You'll get the best prices on eBay, but you'll need a stellar seller rating (or a friend who's willing to sell for you) and the patience to take lots of photos and write up a detailed description of the phone, as well as to package and ship the phone once it's sold.

As with all our resale options, the better condition your phone is in, the more you can get for it. But even dead or damaged items will sell for parts. Just be very clear about your phone's condition.

According to completed sales listings, I could get between $240 and $300 for my 4S, my editor's 4 would command $150-$205, and her 3G would bring in $20-$70. An iPhone 5 in excellent condition could go anywhere from $375 to $500 or more.

Don't have the patience for eBay? Try Gazelle.com, which also offers cash for phones. You'll have to mail in the item (shipping is free), and you take the chance that Gazelle's evaluators may assign a lower value than is provided on the website.

The prices are lower than eBay's, but Gazelle is trustworthy and the process is a breeze. My 4S would get me $190, the 4 would earn my editor $115, and her 3G would bring in $10. A 5 in good condition is worth $310. (These prices are good through Oct. 31. You can lock them in now and then send the old phone once you've gotten your new one.) Gazelle also accepts non-working iPhones.

Get credit
Apple's recycling program offers great prices for old iPhones, but you get the money in the form of an Apple Store gift card, so it's best for those who are definitely upgrading.

Like Gazelle, you get an estimate online based on information you provide about the condition of the phone and mail it in to get your credit. Unlike Gazelle, broken phones won't get you any cash, but you can recycle them for free.

This is the option I'm going with. I can get $215 for my 4S, enough for a brand-new gold 5s. My editor can get $135 from Apple for her 4 (enough for a candy-colored 5c and change), but sadly, her 3G is deemed worthless.

Amazon.com also offers a similar program, though it's much harder to get a sense of your exact trade-in amount. I have used Amazon's trade-in program for everything from books to video-game systems and always found the prices fair and the process painless. This is a good option if you want the ease of Apple's trade-in program without being locked into buying its products.

If you want the best deal, opt for the trade-in program and take your money in the form of an Amazon credit. (You can also sell the phone for cash, but you'll probably get quite a bit less for it.)

The iPhone 5 is worth $292-$344, I could get up to $205 for my 4S, the 4 falls in the range of $90-$135, and the 3G would get $20-$35.

Beware of in-store buybacks
You may have heard that Best Buy and Wal-Mart are offering in-store iPhone swaps -- sounds easy right? Just print this out and bring it with you when you go, as the prices offered from the big-box stores are often quite a bit lower than what you can get through a mail-in trade program like Apple's or Gazelle's.

That's not to say you can't get a good deal – and it's tempting to walk out with a new phone the same day -- but be sure you know what your device is worth so you can make an informed decision.

Whatever you do, don't let those old iPhones sit around in a drawer unused -- the longer you wait, the less you'll get. Happy upgrading!

Robyn Gearey owns shares of eBay. The Motley Fool recommends and owns shares of Amazon.com, Apple, and eBay. Try any of our  newsletter services free for 30 days. We Fools don't 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.