San Francisco’s tech leaders have been divided for weeks over Proposition C, a ballot measure that would raise taxes on the city’s largest companies to fund homeless services. Salesforce chief Marc Benioff, who supports Prop. C, and Jack Dorsey, head of Twitter and Square, who opposes it, have been the most visible figures in the debate.

Their public jousting has highlighted the city’s gross receipts tax, the vehicle through which Prop. C would raise hundreds of millions of dollars for shelter, treatment and other programs. The complex tax is poorly understood, yet its particulars play a crucial role in shaping the stances of those on both sides. Here’s what you need to know about it.

What is the gross receipts tax?

Though the name suggests it’s a tax on overall revenue, the city uses as its basis a concept called “San Francisco gross receipts.” Those start, in most cases, with a company’s worldwide revenue multiplied by an “apportionment percentage.” That apportionment varies by business category — retail, construction, information and financial services. There are 20 in total.

Some businesses pay a rate that’s a 50/50 blend of the share of their total payroll that’s in San Francisco and a share of their total revenue that’s in San Francisco. Others — most notably financial firms — pay a rate based purely on their share of worldwide payroll in San Francisco.

That calculation is then applied to their worldwide revenue to arrive at San Francisco gross receipts. That’s multiplied by a tax rate that varies by business size and category between 0.075 and 0.65 percent to calculate the tax owed.

Overall, the bigger a business is and the more concentrated its employee base or revenue is in San Francisco, the higher a rate it will pay, but the category matters a lot in what it owes.

That sounds really complicated.

You’re not wrong.

Why does San Francisco have such a complex tax system?

Previously, San Francisco charged businesses a tax on payrolls over $250,000. In 2004, the city updated its code to include stock options, which it previously hadn’t taxed, but it didn’t enforce that provision for years. In 2011, as the city started making noises about taxing options as the law required, tech companies and business trade groups began complaining about the payroll tax. Other businesses had more general concerns about the payroll tax, which they saw as discouraging hiring by adding to the overall cost of employment.

So in 2012, with the backing of businesses, city voters passed Proposition E, which introduced a gross receipts tax designed to replace the payroll tax in phases. Since the payroll tax wasn’t immediately eliminated, the city also introduced a tax break for businesses that located in Mid-Market, known as the “Twitter tax break.” It was an oddball trade-off meant to bolster a depressed area downtown.

The payroll tax was supposed to be eliminated this year, but because the gross receipts tax didn’t raise enough money, the payroll tax has stuck around, albeit at a reduced rate of 0.38 percent for 2018. So now the city has two systems of business tax.

Notably, Dorsey, who was then running just Square (a co-founder of Twitter, he was fired as its CEO in 2008 and did not re-assume the role until 2015), supported Prop. E, as did most business leaders.

How would Prop. C change the gross receipts tax?

Though it’s often described as hiking the gross receipts tax by 0.5 percent for companies making more than $50 million in gross receipts a year, that’s an overall figure. The actual rate varies more or less as it does for the current tax. Depending on category, businesses would pay an additional 0.175 to 0.69 percent.

Does Prop. C raise the payroll tax?

This is a bit of a misconception. There’s a loophole-closing provision in the gross receipts tax called the “administrative office tax.” The concept is if you have a head office with a few well-paid executives but little of your payroll or revenue is in the city, you shouldn’t escape taxation. Businesses that fit that description and have more than 1,000 U.S. employees and more than $1 billion in combined gross receipts pay 1.4 percent of local payroll under existing law — essentially, the old payroll tax. Prop. C would raise the rate on such businesses by 1.5 percent.

Why would Square, which is much smaller than Salesforce, pay more under the tax?

Benioff, who volubly supports Prop. C, said his company, which expects to pull in around $13 billion in revenue this year, could easily afford the $10 million additional tax it would owe under Prop. C. Dorsey said Square, which forecasts revenue of about $3 billion this year, would pay an extra $20 million.

The difference comes down to how the city categorizes those businesses for tax purposes — and it’s important to know that Square has fought with San Francisco over its classification.

In May, in a filing with the Securities and Exchange Commission signed by Dorsey, Square disclosed that the city’s tax collector “believes the company’s primary business activity is financial services rather than information services,” and had issued a decision to that effect. That translates to a tax rate increase from 0.475 percent to 0.56 percent on its gross receipts.

But Square took a much bigger hit than that, because financial companies’ San Francisco gross receipts are calculated differently than software companies’. Financial firms pay the tax on a share of their worldwide revenue that is equal to the share of their payroll in San Francisco. Software companies calculate their gross receipts based 50 percent on the proportion of local payroll and 50 percent on their share of sales in San Francisco.

Roughly two-thirds of Square’s 2,338 employees are based at headquarters; for Salesforce, it’s about 28 percent of 30,000 global employees. Though neither breaks out sales by city, it’s easy to guess that their hometown accounts for a tiny percentage of sales. That means that Square would cut its gross receipts tax by more than half if it were put in the same category as Salesforce. Square would get the same savings on the added tax imposed by Prop. C. That’s how you land on Square paying twice as much as Salesforce on a smaller revenue base.

Dorsey hasn’t commented on what Twitter would pay, but assuming it is categorized as an information company, its proportional burden would be more like Salesforce’s. Its payroll tax break under the Mid-Market exemption — for which Square, though its office is one block away on Market Street, isn’t eligible — expires in May.

Who else is affected?

Stripe has not said which category it is in, and the city cannot reveal such information, which is deemed part of a taxpayer’s private return. But Stripe has said it is affected similarly by the gross receipts tax and its CEO, Patrick Collison, has spoken out against Prop. C. The startup, which like Square processes credit card and debit card transactions, is privately held, so it has not disclosed its revenue, but analysts told Bloomberg it’s about $1.5 billion a year. (Stripe did not respond to a request for comment.) Based on a search of LinkedIn profiles, about two-thirds of Stripe’s employees work in its San Francisco headquarters.

Because it is impossible to know which categories companies are in unless they voluntarily disclose that information, as Square has done, it’s impossible to determine the impact of tax changes. But it’s easy to spot some inequities. Uber, which operates its ride-hailing service worldwide, is neutral on Prop. C. Lyft, which opposes Prop. C, has only begun expanding internationally, has a more concentrated workforce and has said that its hometown is one of its bigger markets. Assuming the companies are in the same category, Lyft would almost certainly pay more local tax on every dollar of revenue.

Why else do some people dislike a gross receipts tax?

Let’s say you swipe a card on a Square terminal to buy a latte at Blue Bottle with a Wells Fargo Visa card. (Conveniently, those are all San Francisco companies.) Blue Bottle pays tax to the city based on the $4 cost of the latte. Square charges a few nickels to process that payment; that fee adds to Square’s gross receipts, on which it is also taxed. It pays a portion of that to Wells Fargo and Visa, which are also San Francisco companies, and — you guessed it — they too pay tax on their share. Critics of the gross receipts tax point out that taxing a transaction so many times adds to businesses’ costs, which get passed on to customers in the form of higher prices. That’s why Europe, Canada and other places have largely gone with value-added taxes, which seek to avoid those rounds of taxation.

What would it take to change the tax?

Because Prop. E and Prop. C were ballot measures, further changes to the tax system also require a vote. The earliest that tax reform could be put on the San Francisco ballot is 2019.

Owen Thomas is The San Francisco Chronicle’s business editor. Email: othomas@sfchronicle.com Twitter: @owenthomas