facebook twitter instagram linkedin google youtube vimeo tumblr yelp rss email podcast phone blog search brokercheck brokercheck Play Pause
Tax on Stocks in Pennsylvania: What Investors Need to Know in 2027 Thumbnail

Tax on Stocks in Pennsylvania: What Investors Need to Know in 2027

TRICKS OF THE TRADE

Tax on Stocks in Pennsylvania: What Investors Need to Know in 2027

Prepared by Michael Menninger, CFP®


If you own stocks in Pennsylvania, you may have wondered: How much tax will I pay when I sell my stocks?

The answer depends on several factors, including how long you owned the investment, your cost basis, your income, and whether the stocks are held in a taxable brokerage account or a retirement account.

Pennsylvania's rules are also different from the federal tax rules, which can make stock tax planning confusing.

The good news is that once you understand the basic rules, you can make much more informed decisions about when and how to sell your investments.

How Are Stocks Taxed in Pennsylvania?

When you sell a stock for more than you paid for it, the difference is a capital gain.

For example, if you purchase $40,000 of stock and later sell it for $100,000, you have a $60,000 gain.

For Pennsylvania residents, that gain is subject to Pennsylvania's 3.07% personal income tax. Unlike the federal government, Pennsylvania does not have separate tax rates for short-term and long-term capital gains.

Using the example above:

$60,000 gain × 3.07% = $1,842 Pennsylvania tax

Your actual tax liability can vary depending on your complete tax situation, but this illustrates the basic Pennsylvania calculation.

Does Pennsylvania Have a Long-Term Capital Gains Tax Rate?

No. This is an important distinction for Pennsylvania investors.

The federal government gives preferential tax treatment to investments held for more than one year. Pennsylvania does not have a separate preferential capital-gains rate.

Whether you held the stock for six months or six years, Pennsylvania taxes the gain at its 3.07% personal income tax rate. The federal tax treatment can be considerably different.

How Does the Federal Government Tax Stock Gains?

For federal income tax purposes, stock gains are divided into short-term and long-term capital gains.

Short-Term Capital Gains

If you hold a stock for one year or less, the gain is considered short-term. Short-term capital gains are taxed at your ordinary federal income tax rate.

Long-Term Capital Gains

If you hold a stock for more than one year, the gain qualifies for long-term capital-gains treatment.

For 2026, the federal long-term capital-gains rates are 0%, 15%, or 20%, depending on your taxable income and filing status.

Why the Holding Period Matters

This difference can make the timing of a stock sale important. Selling an investment just a few months before reaching the one-year holding period could result in very different federal tax treatment than waiting until the investment qualifies as a long-term gain.

What Is the Net Investment Income Tax?

Higher-income investors may also have to consider the 3.8% Net Investment Income Tax (NIIT).

The NIIT can apply to investment income, including capital gains and dividends, when modified adjusted gross income (MAGI) exceeds $200,000 for single taxpayers, $250,000 for married couples filing jointly, or $125,000 for married individuals filing separately.

For some higher-income investors, the federal tax on a long-term capital gain can therefore be as high as 23.8%, before considering Pennsylvania's 3.07% tax.

What About Dividends From Stocks?

Stocks can create taxable income even if you never sell them. If a stock pays dividends, those dividends may be taxable.

At the federal level, qualified dividends can receive the same preferential 0%, 15%, or 20% rates that apply to long-term capital gains, assuming the applicable requirements are met.

Pennsylvania treats dividends differently. Dividend income is generally subject to Pennsylvania's 3.07% personal income tax rather than receiving the same preferential treatment available federally.

This is another reason Pennsylvania investors should not assume their federal and state tax returns will treat investment income the same way.

What Happens If I Sell Stocks at a Loss?

Selling an investment for less than you paid is never enjoyable, but investment losses can sometimes be useful from a tax-planning perspective.

For federal purposes, capital losses can offset capital gains. If your capital losses exceed your gains, you may be able to deduct up to $3,000 of the excess against other income, with additional losses carried forward to future years.

Pennsylvania Capital Losses Are Different

Pennsylvania does not allow capital-loss carryforwards. This means Pennsylvania's treatment of investment losses can be very different from the federal rules.

Pennsylvania also does not follow the federal wash-sale rules for Pennsylvania personal income tax purposes.

That does not mean you should ignore federal wash-sale rules. A transaction may receive different treatment on your federal and Pennsylvania tax returns.

This is one area where tax-loss harvesting should be coordinated carefully rather than treated as an automatic year-end strategy.

Are Stocks Taxed Differently in an IRA or 401(k)?

Yes. One of the most important questions when discussing stock taxes is where you own the investment.

If you sell a stock inside a traditional IRA or 401(k), you do not owe capital-gains tax simply because the investment increased in value and you sold it inside the account. Instead, taxation occurs when money is withdrawn from the retirement account, subject to the rules governing that account.

Roth IRAs have different rules, and qualified withdrawals are tax-free.

Why Account Location Matters

Imagine you own the same stock in two different accounts: a taxable brokerage account and a traditional IRA. Selling the stock could have completely different tax consequences depending on which account owns it.

This is why investment management and tax planning should not be treated as two separate conversations.

Where you own an investment can be just as important as what you own.

What About RSUs, Stock Options and ESPPs?

Employees may receive company stock through Restricted Stock Units (RSUs), Employee Stock Purchase Plans (ESPPs), Incentive Stock Options, or Nonqualified Stock Options.

These investments can create multiple tax events. For example, RSUs can have tax consequences when shares vest and additional consequences when the shares are eventually sold.

ESPPs and stock options can be even more complicated because the tax treatment depends on the type of plan, purchase price, holding period and other factors.

If you receive company stock through your employer, I recommend understanding the tax consequences before you sell. Once the transaction occurs, many planning opportunities disappear.

How Can Pennsylvania Investors Reduce Taxes on Stocks?

There is no magic strategy that eliminates taxes. But there are legitimate ways to potentially improve your after-tax investment results.

Consider the Tax Impact Before Selling

One of the most common mistakes is selling an appreciated investment and asking about the tax consequences afterward.

Before selling a large stock position, consider:

  • Your cost basis
  • The size of the potential gain
  • Other gains and losses
  • Your federal tax bracket
  • The potential NIIT
  • Pennsylvania tax
  • Your overall investment objectives

Sometimes the right answer is to sell everything. Sometimes it makes more sense to sell gradually. And sometimes the tax cost is worth paying because the investment no longer fits your financial plan.

Consider Tax-Loss Harvesting

Selling investments that have declined in value can potentially create losses that offset gains elsewhere. However, federal and Pennsylvania rules are different, so tax-loss harvesting should be coordinated with your complete tax situation.

Consider Gifting Appreciated Stock

Selling appreciated stock is not the only way to reduce a concentrated position.

Depending on your circumstances, you may be able to donate appreciated securities to a qualified charity. This can potentially allow you to support a charitable organization while avoiding the capital-gains tax that otherwise could result from selling the investment.

There are specific rules surrounding charitable gifts, so this strategy should be discussed with your financial planner and tax professional.

The Biggest Mistake Pennsylvania Investors Make

One of the biggest mistakes I see is focusing on the investment return without considering the tax consequences.

An investor may say, "I made 200% on this stock, so it was a great investment." Maybe it was.

But the more important question is: How much of that return do you actually get to keep?

Taxes, investment expenses, inflation and risk all affect your real-world results.

The goal isn't to avoid taxes at all costs. Sometimes paying a tax bill is exactly the right decision if it means moving out of an investment that no longer makes sense for your financial plan.

The goal is to make the decision with the tax consequences in mind.

The Bottom Line on Tax on Stocks in Pennsylvania

So, how are stocks taxed in Pennsylvania?

For Pennsylvania residents, stock gains are subject to the state's 3.07% personal income tax. Pennsylvania does not have a separate long-term capital-gains tax rate.

The federal government provides preferential tax treatment for long-term capital gains, while short-term gains are generally taxed as ordinary income. Higher-income investors may also be subject to the 3.8% Net Investment Income Tax.

The important question isn’t simply, "What tax rate will I pay?"

It is: When should I sell, how much should I sell, and what will the transaction mean for my overall financial plan?

If you are considering selling a highly appreciated stock, receiving company stock, or making a significant change to your investment portfolio, having the tax conversation before making the trade can be valuable.

At Menninger & Associates, we believe investment management and tax planning should work together. A successful investment strategy isn't simply about growing your money. It's about understanding how taxes can affect the wealth you ultimately keep.

Frequently Asked Questions About Tax on Stocks in Pennsylvania

1. Is there a capital gains tax on stocks in Pennsylvania?

Yes. Pennsylvania taxes gains from the sale of stocks at its 3.07% personal income tax rate. Unlike the federal government, Pennsylvania does not have separate tax rates for short-term and long-term capital gains.

2. How much tax do I pay when I sell stock in Pennsylvania?

The Pennsylvania tax on a taxable stock gain is generally 3.07% of the gain. For example, if you have a $60,000 taxable gain, the Pennsylvania tax would generally be $1,842.

However, you may also owe federal capital-gains tax, and higher-income taxpayers may be subject to the 3.8% Net Investment Income Tax. Your total tax liability depends on your individual circumstances.

3. Does Pennsylvania tax long-term capital gains?

Yes, but Pennsylvania does not provide the same preferential tax rate for long-term capital gains that the federal government does. For Pennsylvania purposes, a stock gain is subject to the state's 3.07% personal income tax regardless of whether you held the investment for six months or several years.

4. Can I deduct stock losses on my Pennsylvania tax return?

Pennsylvania's treatment of investment losses is different from the federal rules. Pennsylvania does not allow capital-loss carryforwards, meaning a Pennsylvania capital loss cannot be carried into future tax years.

Federal tax rules are different and may allow capital losses to offset capital gains and, subject to limitations, other income.

5. How can I reduce taxes when selling stocks in Pennsylvania?

There are several strategies that may help manage the tax impact of selling stocks, including tax-loss harvesting, strategically timing sales, donating appreciated securities, and considering which investments are held in taxable versus retirement accounts.

The right strategy depends on your income, investment objectives, cost basis, charitable goals and overall financial plan. For a large or highly appreciated stock position, it can be valuable to discuss the tax consequences before selling.

If you have questions about year-end tax planning strategies, Roth IRA conversions, retirement planning, or your overall financial picture, contact the Certified Financial Planners at Menninger & Associates Financial Planning to discuss your needs.



The opinions voiced in this article are for general information only and are not intended to provide specific advice or recommendations for any individual. To determine which strategies may be suitable for you, consult the appropriate qualified professional prior to making a decision. Menninger & Associates Financial Planning and LPL Financial do not offer tax advice or services. Traditional IRA account owners have considerations to make before performing a Roth IRA conversion. These primarily include income tax consequences on the converted amount in the year of a conversion, withdrawal limitations from a Roth IRA, and income limitations for future contributions to a Roth IRA. In addition, if you are required to take a required minimum distribution (RMD) in the year you convert, you must do so before converting to a Roth IRA.

Securities and advisory services offered through LPL Financial, a Registered Investment Advisor, Member FINRA/SIPC.

(610) 422-3773