Whether you're a W-2 employee or self-employed, you pay into Social Security and Medicare with every paycheck. For W-2 wage earners, 6.2% of your paycheck -- up to a limit of $147,000 in 2022 -- goes toward Social Security, while 1.45% goes toward Medicare. Your employer is taxed at the same rates.

If you're self-employed, you're both the employer and the employee, so you're taxed twice this amount. That's 12.4% for Social Security (up to the same limit) and 2.9% for Medicare (with no limit) for a combined payroll tax rate of 15.3%.

After a lifetime of hard work, you get this money back in the form of monthly Social Security payments that kick in as early as age 62 and Medicare benefits that begin at age 65. While you may have heard that Medicare Part A is free, that's only partly true. Though the premium is free, this portion of Medicare still charges deductibles and coinsurance -- all of which are out-of-pocket costs that you'll have to foot by yourself.

Healthcare worker pushing a senior in a wheelchair.

Image source: Getty Images.

Medicare Part A: Only the premium is free

For most retirees, Medicare Part A's premium is free, which is why it's often referred to as "premium-free Part A." This part of Medicare provides hospital insurance, which covers medical services like inpatient hospital care, nursing home care, skilled nursing care, hospice care, and home healthcare. Part A also covers surgery, lab tests, and other procedures that are associated with those healthcare services.

To get Medicare Part A for free, you'll need to have 40 work credits, equivalent to 40 quarters or 10 years of work in which your income was subject to payroll taxes. If you worked for less than 10 years, you'll need to pay for Part A. Nonworking spouses can also get Part A at no premium cost if their spouse met the work history requirement.

Your exact premium will depend on the length of time worked. If you worked between 30 and 39 quarters, you'll pay $274 per month in 2022. If you worked for less than 30 quarters, you'll pay the full premium of $499 a month.

The Part A deductible

However, even if you qualify for premium-free Medicare Part A, remember that you'll still be responsible for cost-sharing charges -- including both deductibles and coinsurance.

For starters, every Medicare Part A enrollee is subject to a $1,556 deductible in 2022. This is the amount you must pay out of pocket for each benefit period before Medicare coverage kicks in, and it's owed on top of what you pay in premiums, if any.

A Medicare benefit period is defined as the length of time between the day of your admission to a hospital or nursing facility and the day you are discharged. A new benefit period begins if you have not received hospital or nursing facility care for 60 consecutive days.

It's important to note that unlike the deductibles charged by the employer-sponsored, marketplace, or private insurance plans that you might be used to, the deductible associated with Medicare Part A isn't an annual deductible. Instead, you must pay the deductible for each new benefit period, which there can be several of in a single year.

Part A coinsurance costs

After meeting your deductible, you'll owe a daily coinsurance amount during each benefit period. From days 1 to 60 of each benefit period, you'll owe $0. Between days 61 and 90, you'll owe $389 per day, and after day 91, you'll owe $778 per day.

Each day beyond day 90 in a benefit period will eat into a "lifetime reserve day," which you have 60 of in your lifetime. If you run out of lifetime reserve days, Medicare will no longer cover your costs, and you'll be on the hook for all bills after the 90th day of that benefit period.

Affording your medical care in retirement

Medicare Part A's deductibles and coinsurance costs can easily add up to thousands of dollars per year. If you experience a long inpatient stay, your out-of-pocket costs may stretch into the tens of thousands of dollars. In general, expect to spend about $1,000 a month in out-of-pocket healthcare costs at age 65, and about $3,000 a month at age 85.

Luckily, you can plan and budget for these expenses. For example, if you had a high-deductible health plan (HDHP) and contributed to a health savings account (HSA) during your working years, you could tap into those funds to help offset some of your healthcare costs in retirement.

If your employer offers retiree insurance, you'll get access to a second health insurance policy that can help you cover more of your out-of-pocket expenses. Similarly, if you delay retirement or work part-time after retiring, you may qualify for benefits like an employer-sponsored health plan -- which can further help defray some of your costs.

Of course, you can also purchase insurance to help you supplement Medicare coverage on your own dime. Companies like UnitedHealth Group (UNH 1.00%) and Humana (HUM 1.07%) offer plans that can be combined with Medicare to provide more comprehensive health coverage.

Getting a good grasp on how much you can expect to spend on medical care is an important first step toward health and wellness -- both physically and financially.