An analysis of Twitter's latest filing with the Securities and Exchange Commission reveals that the value of the Mid-Market payroll tax break that San Francisco granted the company in 2011 will run far higher than earlier estimates.

The city could forgo an additional $34 million in revenue just from stock grants that can be exercised and sold after the company's initial public offering, expected in the next few weeks, according to a rough calculation done in partnership with Jim McHale, a certified public accountant who operates namesake San Francisco firm James J. McHale, CPA.

That's on top of the $22 million estimate produced several years ago in an analysis for the San Francisco Board of Supervisors, while the payroll tax issue was under debate. That prediction didn't include the larger impact of a possible stock offering, examining only the effect from employee salaries, said Fred Brousseau, principal at Harvey Rose Associates, a budget analysis firm under contract with the supervisors.

"Too much information wasn't available at the time," he said. "It really would have been taking a shot in the dark."

But Twitter's most recent SEC filing filled in some critical blanks, allowing at least a back-of-the-envelope estimate that pushes the total past $56 million. The company has 42.7 million outstanding stock options, with a weighted-average exercise price of $1.84 per share. It provided employees an additional 85.7 million shares of restricted stock units.

The city previously treated both as taxable compensation at 1.5 percent - and still would do so in some circumstances.

In November, voters approved a shift from the payroll tax to a gross receipts tax, which will be phased in beginning next year. But the city previously granted a partial exemption on payroll tax for companies that located in the Mid-Market district, a bid to keep fast-growing companies like Twitter.

The 2011 tax break let companies cap payroll taxes at the amount they were paying when they finalized the agreement for any six years in an eight-year period.

Twitter, which plans to go public on the New York Stock Exchange, has set its stock offering at between $17 and $20 per share. If all of its executives and employees unloaded their options and restricted stock units at the midpoint of $18.50, they would make $2.3 billion (after subtracting what they'd have to pay to buy some of those shares at the option price). That would add up to $34 million in lost tax revenue.

Twitter also has tens of millions of shares reserved "to be issued under equity compensation plans."

There are some critical caveats to these estimates. Obviously not all employees will unload all their shares at the $18.50 price, and they certainly won't all do so at the same time. Many will hold onto their shares for years, potentially beyond the remaining life (any four of the next six years) of the tax deal.

We also only know the average exercise price of those tens of millions of options. The actual prices will vary, altering the total impact.

Finally, as with any offering, the stock price could also decline after it begins trading, as Facebook's shares did. And employees generally won't be able to sell their shares for months, until the SEC lockup period ends.

But observers believe that Twitter is being conservative in the pricing of the shares. If the price climbs significantly above $18.50 per share, the impact of the tax break could rise far higher.

Twitter, which is in quiet period ahead of its IPO, didn't respond to an inquiry.