If you’re torn between investing your tax refund and spending it, try this: Invest in yourself by spending it on your health.

About 34 percent of consumers will make a large purchase with their tax refunds this year, while 7 percent intend to invest in the stock market, according to a NerdWallet poll. A large purchase is often tempting, and some items, such as a low-maintenance car or energy-efficient appliance, can sometimes be a necessary investment. And such a buy might be less risky than putting money in the stock market.

It’s a tough choice, but fortunately there’s a happy medium. By spending your refund on becoming healthier today, you could save yourself thousands in medical costs down the road.

Here are some ways you can invest in a healthier you, including an investment that doubles as a financial one for those people who qualify:

READ MORE: What preventive care is free?

1. Contribute to your HSA

If you have a health savings account, consider adding some of your refund money to it, especially if you go to the doctor frequently or have a chronic condition. HSAs— special savings accounts you can use to pay medical costs— are available to people with high-deductible health plans, or HDHPs.

READ MORE: What an HDHP is and how to know if you should get one

If you already have an HSA, here’s another incentive to put some of your tax refund there: HSA money can be invested and grow over time, just like a 401(k). If you switch out of your high-deductible health plan in the future, you can no longer contribute to the account. However, you keep the money already contributed, and if it’s invested, the money will continue to grow.

You can keep using the money for qualified medical expenses no matter what health plan you have in the future, and if it lasts until you reach age 65, you can use your HSA like a retirement account. Money you add to an HSA is tax-free and tax-deductible if you contribute now, but there are limits. This year the limits are $3,350 in contributions to an individual HSA and $6,750 for a family.

READ MORE: 9 smart ways to spend your tax refund

2. Invest in home gym equipment

If you think you’d work out more if you could just do it at home, here’s your chance to start that home gym or supplement the one you already have.

Treadmills can cost more than $2,000, but many are available for less than $900 if you don’t need the fancy display and other extras. Stationary bikes can cost less than $500 for a decent model, and you can get a spinning bike similar to the ones you may see in a gym class for less than $1,000.

Infomercial exercise equipment might pique your interest, but you may be better off choosing something tried and true, similar to what you might find in a membership gym. Gimmicky equipment tends to be used less and discarded, whereas machines that mimic common movements, like biking and running, have stood the test of time, and can help you train indoors for a race or just keep fit.

3. Get a personal trainer

If a personal trainer seems like a splurge, consider a few prepaid sessions bought with your tax return an investment in your fitness instead. No matter your fitness level, there’s a good chance a professional can teach you things that will propel you toward your goals.

READ MORE: 6 benefits of eating healthy

You don’t have to make a weekly commitment to reap the benefits of a professional. Just a few sessions can be enough to learn new moves or get tips you didn’t know you needed. To get your money’s worth, use a trainer who’s been certified by either the American Council on Exercise or the American College of Sports Medicine. They’re usually designated as an ACE- or ACSM-certified personal trainer.

4. Invest in high-quality gear

If you’re serious about fitness, spending a little more money on items you already use, such as  shoes or fitness trackers, can help you up your game. For example, running shoes are made differently for people with flat feet or high arches; if you’re using the wrong pair because of their low price, they could contribute to joint pain or just wear out faster. Try visiting a running store for a custom fitting to find your perfect shoes.

Fitness trackers are often pricey, but they may help you achieve your exercise goals. Some models run as high as $400, but many less expensive options will also likely meet your needs.

Most of these ideas will cost you less than the average refund this year, which is just under $3,400, according to the IRS. Here’s hoping you have enough for both what you need and what you want.