Elon Musk already faces a federal tax bill approaching $2.7 billion on exercising Tesla Inc. stock options. It would have been bigger if the company’s share price hadn’t fallen after he tweeted about selling stock.

The stock fluctuations have financial consequences for the U.S. government, Mr. Musk and Tesla. When the share price goes down, it not only reduces how much tax the Tesla chief executive owes the U.S. government in the short term, it also lowers his total potential tax payments linked to those shares if he sells...

Elon Musk already faces a federal tax bill approaching $2.7 billion on exercising Tesla Inc. stock options. It would have been bigger if the company’s share price hadn’t fallen after he tweeted about selling stock.

The stock fluctuations have financial consequences for the U.S. government, Mr. Musk and Tesla. When the share price goes down, it not only reduces how much tax the Tesla chief executive owes the U.S. government in the short term, it also lowers his total potential tax payments linked to those shares if he sells them in the future. Any such later sales also may not be taxed by California because Mr. Musk moved his residence to Texas last year.

At the same time, exercising the options at a lower stock price could weigh on the company he controls. The tax deductions that Tesla can claim for that part of Mr. Musk’s compensation package are effectively reduced if he exercises options at lower share prices.

The electric-vehicle maker’s chief executive initiated a wave of exercising Tesla options and selling shares on Nov. 8, and he has now turned more than six million options into shares, selling about $3 billion worth to cover tax withholding along with about $6 billion of other shares.

Mr. Musk made the moves while arguing with lawmakers over tax policy and after conducting a Twitter poll about whether he should liquidate 10% of his stockholdings in Tesla, a plan Twitter users backed. Tesla’s stock slumped more than 15% in the week following the Twitter poll, a period that also included the market debut of electric-vehicle rival Rivian Automotive Inc.

SHARE YOUR THOUGHTS

Are you selling your Tesla shares? Why or why not? Join the conversation below.

The stock-price declines had a significant impact on the tax he owes, lowering it by more than $380 million so far from its recent all-time peak, an analysis by The Wall Street Journal of Mr. Musk’s and Tesla’s securities disclosures shows.

The tax figures are estimates; his actual bills may vary.

On Sept. 14, weeks before his first public comments about selling or his Twitter poll, Mr. Musk had authorized a plan under which he would exercise at least some of his nearly 23 million vested stock options set to expire worthless in August 2022.

The day he set the plan, Tesla shares closed at $744.49. At that price, exercising the options would have cost him $290.50 in federal taxes per share. A day earlier, congressional Democrats had proposed raising tax rates that, if enacted, would mean options exercised in 2022 at that day’s price would cost Mr. Musk $331.84 each.

Mr. Musk, the world’s richest person on paper with a net worth of more than $300 billion, according to the Bloomberg Billionaires Index, doesn’t take a cash salary from Tesla and has at times described himself as cash-poor. Before November, he rarely sold Tesla stock. In September, he publicly signaled that he would face what he called a huge tax bill on exercising options.

The electric-vehicle maker’s valuation rose above $1 trillion after rental-car company Hertz said it had ordered 100,000 Teslas.

Photo: steve marcus/Reuters

Tesla’s shares have risen sharply since September. The company posted strong quarterly results, and rental-car company Hertz Global Holdings Inc.

said it had ordered 100,000 Teslas, sending the valuation of Mr. Musk’s company above $1 trillion.

On Nov. 4, before Mr. Musk exercised an option under the plan or disclosed its existence, Tesla stock hit an all-time closing high of $1,229.91 a share. At that price, Mr. Musk could expect a federal tax bill of about $481.51 for each option he exercised and even more in 2022 under the stiffer Democratic social spending and climate bill that passed the House Nov. 19.

Mr. Musk has reported exercising roughly 6.4 million options through Nov. 19, and his average federal tax cost per share is about $421.59. That is higher than it would have been in September but more than 12%, or $382 million, below the early November highs. Because he is selling newly obtained shares to pay the taxes, he generally ends up with the same number of shares regardless of the price, just at a lower cost basis and with less cash owed to the government than when the price was higher.

Neither Mr. Musk nor the electric-vehicle company responded to requests for comment. They haven’t disclosed the details of the preset trading plan. Such plans can prompt sales or purchases at specific dates or share prices.

Tesla will move its headquarters to Austin, Texas, said CEO Elon Musk, comparing the current crowded operations at the factory in Fremont, Calif., to ‘Spam in a can.’ He said the electric-vehicle maker would continue expanding in California. Photo: Brendan Smialowski/AFP/Getty Images The Wall Street Journal Interactive Edition

As Mr. Musk continues to exercise his options, his tax bill shrinks if Tesla’s share price falls, but the company fares worse—it gets smaller tax deductions for Mr. Musk’s compensation at lower share prices. For every $1 million that Mr. Musk’s option-exercise income goes down, he saves $370,000 in federal income taxes, and Tesla loses $210,000 worth of deductions.

That tension can be lessened when the fortunes of a company and its largest shareholder are intertwined if they are trying to get the lowest combined tax bill.

“You can see there may be an incentive in combination for the parties to lowball the value, that Tesla only gets a 21% deduction and Musk is picking it up at 37%,” said Steve Rosenthal, senior fellow at the Tax Policy Center in Washington. “Every dollar lower saves, collectively, 16 cents for the two parties.”

Mr. Musk, in a Nov. 13 tweet, pointed to his sales of Tesla stock that he had held for a longer time than the ones just obtained by options. He owes more in capital-gains tax than he would have if he had instead sold his newly obtained shares. “A careful observer would note that [this is]...  closer to tax maximization than minimization,” he wrote.

Mr. Musk’s tax for exercising his options is calculated on the difference between the price he has to pay to exercise the option, the so-called strike price, and the value of the shares when the option is exercised. The options that expire in August cost $6.24 to exercise and the difference between that and the actual share price is taxed as ordinary income. That is a 37% top tax rate plus 2.35% in Medicare taxes and likely more in California taxes because he lived and worked there during part of the time he held the options.

Even for a long-term holder of Tesla stock, as Mr. Musk has been, there are other reasons a near-term share dip around the time of exercising options benefits him as he increases his holdings.

If Mr. Musk thinks Tesla is a good long-run investment above current prices, his incentive is to spend as little money as possible to secure more shares. Unlike a typical stock sale where the executive ends up with more cash after taxes if the share price is higher, these transactions are different. They typically require him to spend cash or surrender shares and leave him with shares, but not cash.

Beyond that, future gains above the exercise price are taxed as capital gains. If held for more than a year and then sold, that means a 23.8% rate under current law or a 31.8% rate under the Democratic plan, both lower than ordinary income tax. Those gains also would likely not be taxed in California, because Mr. Musk moved to Texas last year.

If Mr. Musk, 50 years old, holds those shares until his death, he wouldn’t pay any income tax, a policy he labeled “questionable.” His heirs would receive the shares and would owe income taxes only when they sell and then only on the further appreciation after his death. Estate taxes may apply.

“Probable capital allocation skill of heirs is lower than original creator,” he tweeted this month, “so I am in favor of an estate tax.”

Write to Richard Rubin at richard.rubin@wsj.com, Rebecca Elliott at rebecca.elliott@wsj.com and Theo Francis at theo.francis@wsj.com