The search for the perfect jeans that make your butt look good has been portrayed in film, books and TV. But the search for the perfect denim stock has never ended. There are plenty of companies that carry denim, but three companies are worth diving into: Gap (GPS -0.80%), The Buckle (BKE 0.38%) and Urban Outfitters (URBN -0.14%).

Fashion backward?
Gap is the largest of these retailers. Last week Gap was downgraded by John Morris of BMO Capital due to concerns over macroeconomic retail headwinds, high inventories, sluggish sales, and a competitive promotional environment.

CEO Glenn Murphy answered an analyst question about denim on the second quarter earnings call, "As far as denim is concerned, it's a dominant category for both Gap and for Old Navy." He spent considerable time explaining that the company is pulling back on the colored denim so popular last year and moving to more indigo-centered styles. Morris doesn't think that Gap has the right stuff, though, noting on the BMO downgrade that Gap has a "lack of a clear fashion consensus" and "mixed feedback on Fall and Holiday products."

After Gap's recent pullback on the downgrade and after a decline of 3% for September same store sales, long term investors might be tempted by the 2.2% yield and the 13.68 trailing earnings multiple. Stay away until holiday numbers come out.

All denim all the time
Denim retailer The Buckle is the most pure play on jeans here. Its same store sales were worse than Gap's in September, down 4.5%. However, The Buckle has so many great things going for it: its regular dividend yielding 1.7%, frequent special dividends, no long term debt, and a reasonable trailing earnings multiple of 13.66. That regular dividend tacked on to last December's special dividend added up to an 11.1% annual yield. Don't forget a net profit margin of 14.47%.

New product comes in daily to The Buckle. Also, only one-third of The Buckle's sales are its own private-label brand, with the remaining sales coming from top denim brands like Affliction, Savage, and Hurley. It also offers value-added services in store like fit consultations, alterations, and personal-shopping service. The Buckle also has high insider ownership of 41% and a strong promote-from-within policy, which motivates employees.

There are plenty of naysayers on The Buckle; it has a considerable short interest of 24%. The stock is off almost 20% from summer highs when it reported second-quarter EPS inline with previous guidance and beat on revenue. However, with strong consumer reluctance to spend on anything but essentials, The Buckle board may feel that way, too, and decide their traditional special dividend won't be under the tree this year. Longer term, The Buckle is still a buy.

Hipster jeans
Urban Outfitters is one company that gets denim. Like these other two it has a clean balance sheet, and like Buckle it has no long term debt.

It operates several different brands: legacy brand Urban Outfitters, Free People, BHOLDN (weddings and special occasion apparel), Anthropologie, and Terrain (home and garden). Urban Outfitters, Anthropologie, and Free People make up over 90% of Urban Outfitters' 500 stores.

Its stores are a destination shopping experience, a source of entertainment, with constant new and unique merchandise similar to The Buckle. Between Free People and Urban Outfitters over 500 different denim styles are available for women and men.

Like Gap, Urban Outfitters is also global. The company now ships to 123 countries and looks to keep the momentum going worldwide. Online is a strong point at Urban Outfitters. E-sales were up in the last quarter by 5% at Urban Outfitters, 9% at Anthropologie, and a very impressive 38% at Free People.

However, the company unleashed a firestorm on Sept. 9 when it disclosed that third quarter comparable sales were only up 5.2% instead of 9% as the company predicted. Significant markdowns were taken on Urban Outfitters' merchandise on Labor Day. The disclosure sunk the stock by 10% in one day.

Tempest in a teapot? At least it made the stock more affordable. It now trades at a 21 trailing earnings multiple. The company has had several analyst upgrades since the brouhaha. With ten year compound annual sales and earnings growth rates of 21% , a growing direct to consumer segment which is now 25% of total sales, and a 210 basis point margin improvement for fiscal year 2013, the company should ride out the storm quickly.

Buy two, sell one
Longer term, Buckle is still a buy. Temporary headwinds shouldn't keep longs from what has been a stellar stock and a well-managed company. Denim isn't going away, and neither is Buckle.

Urban Outfitters also hit a short term bump in the road. However, it is a growing and unique retailer that understands what men and women from 18-45 want, especially in denim.

Gap's sluggish sales and lack of vision are enough reasons to stay away.