WASHINGTON - Unemployment is rising. Nest eggs are in tatters. Home values have tanked. And yet surprisingly, Americans are feeling less stress from debt these days.

Chalk it up to the power of positive thinking combined with people saving more, spending less, and trimming debt to cope with the recession.

The upshot is that more people are optimistic that they will eventually be able to get out from under a mountain of bills, a major factor behind the decline in stress from last year, according to a Associated Press-GfK poll.

Debt-related stress was 12 percent lower this year than in 2008, according to the poll. “People now have some optimism that the worst is behind them,’’ said Paul J. Lavrakas, a psychologist and AP consultant who analyzed the results of the survey.

The recession, the longest since World War II, is prompting Americans to take steps to get their finances in better shape. It has led to a newfound frugality that some believe will continue long after the recession ends.

“People are doing things that make them feel they are taking charge of their lives again,’’ said Patricia Drentea, associate professor of sociology at the University of Alabama at Birmingham, who studies debt and stress.

Ironically, some of these changes - notably a more cautious consumer - could add to the national economy’s stress. If Americans were to sharply cut back spending, that could prolong the recession.

Forty-eight percent of those polled say the country is headed in the right direction, compared with 18 percent who said that in 2008, the poll says.

There is no doubt that the recession, which started in December 2007, has taken a toll on Americans. It has snatched a net total of 6.5 million jobs and driven the unemployment rate up to a 26-year high of 9.5 percent in June.

Americans watched their net worth shrink by $1.3 trillion in the first three months of this year, due mainly to declining stocks and home values, the Federal Reserve says.

On the other hand, Americans aren’t dealing with record-high gas prices as they were last summer. Credit and financial problems, which reached a crisis point last fall, have shown some signs of easing. But it’s still hard for many people to get loans.

“I wouldn’t conclude by any stretch that consumers feel safe or comfortable. But I think the uncertainty has mitigated. Some of the big fears people had at least disappeared some,’’ said James Hamilton, economics professor at the University of California, San Diego.

Last year, 33 percent said they were at least “somewhat concerned’’ that they would never be able to pay off their debts. That’s dropped to 27 percent this year, the poll shows.

Chris Norton, 32, of Robbinsdale, Minn., said he’s much less stressed over debt.

“The debt that we have accumulated . . . it’s gotten knocked down to a reasonable place, where it doesn’t bring stress any more,’’ said Norton. “We have the state of mind that if we keep plugging in the right direction it will kind of work out.’’