Purchasing gifts for friends and loved ones leaves many holiday shoppers in a bind. But for millennials, a new NerdWallet study finds, the outcome is more encouraging.

Maybe older generations could learn a thing or two about holiday shopping from their younger counterparts.

"Millennials often get a bum rap about their spending habits, but the data says otherwise — particularly when it comes to the holidays," said NerdWallet consumer savings expert Courtney Jespersen. "Millennials aren't just setting budgets; they're keeping them, too."

Millennials were the least likely age group to go into debt during the 2016 holiday shopping season and the most likely to stick to their budgets, according to an analysis of spending behavior and trends among millennials (ages 18-34), Gen Xers (ages 35-54) and baby boomers (ages 55+), based on a survey of more than 2,000 U.S. adults commissioned by NerdWallet and conducted by Harris Poll.

And the 2017 holiday season looks promising, too. The results show that millennials often fare better than other generations, which may be a result of how they plan and shop. Their strategies can help you keep your shopping in check.

Millennials curb debt. Although more than half of Americans who shopped during the 2016 holiday season accumulated credit card debt, millennials were far less likely to do so than the other generations: 40 percent of millennial shoppers incurred debt, compared with 58 percent of Gen Xers and 63 percent of baby boomers.

And this group is getting faster at eliminating it — taking an average of 2½ months to pay off their 2015 holiday debt and 1½ months to pay off 2016 holiday debt.

They set the spending bar lower. Just as with the 2016 holiday season, millennials rank third in estimated spending for the 2017 holiday season among those who intend to purchase gifts for friends and loved ones.

The 18-to-34-year-old group plans to spend $434 on average this year, while Gen Xers anticipate spending $679 and baby boomers $802. That's less than millennial shoppers planned to spend in 2016 ($499).

They are using less credit. Overall spending isn't the only thing millennials aim to reduce this year.

Planned credit card and cash use is down: In 2016, 47 percent of millennial shoppers said they would use a major or retail credit card and 67 percent would use cash, compared with 44 and 61 percent respectively for 2017.

Debit cards are millennial shoppers' No. 1 choice — 67 percent say they will use them this holiday shopping season.

They are improving their budgeting skills. Unlike the other generations, millennials are increasingly hitting their target spending.

In fact, from 2015 to 2016, this age group went from the least likely to keep to their holiday budgets to the most likely.

Among those who shopped during the 2016 holiday season, 49 percent of millennials say they stuck to their budgets compared with 40 percent of Gen Xers and 43 percent of baby boomers.

During the 2015 holiday season, 38 percent of millennials who shopped stuck to their budgets compared with 46 percent of Gen Xers and 50 percent of baby boomers.

Jespersen said, "This generation of tech-savvy app users has figured out that it's easier than ever to keep track of receipts and monitor spending."

Lauren Schwahn writes for NerdWallet, a personal finance website.