Let’s say you’re a volunteer firefighter and you want to buy a copy of the California fire code and copy it for your fellow volunteers.

By doing so, you’re breaking the law, according to the state; each of them would have to buy it separately from a national fire safety organization, for a couple of hundred dollars a shot.

“We think that’s nuts,” Carl Malamud told me. “Not only is the code binding law, it’s binding law that’s critical for public safety.”

People are more likely to obey the law if they can find it quickly and understand it and use it.

Carl Malamud, Public.Resource.Org

Or perhaps you’re in the food business, and want your own copy of the state’s food and agriculture code so you can make sure you stay on the right side of the law.

The private firm Thomson Reuters Westlaw will be happy to send you a three-ring binder with the code on paper — for $724. If you want to keep it updated, you’ll have to pay that sum every year.

These are just two examples of how state laws across the country are concealed behind paywalls erected by private companies and organizations for their own profit.

Taxpayers effectively are paying to access their own state laws twice — once through their taxes, which cover the legislative process by which the laws are made, and again just to read them in a convenient format.

Malamud and his nonprofit organization, Public.Resource.Org, have been fighting to bring down these paywalls for years.

Starting in 2016 he focused on two state agencies.

These are the California Building Standards Commission — which is supposed to maintain building, electrical and fire codes among other regulations — and the Office of Administrative Law, which oversees the entire California Code of Regulations covering dozens of categories governing motor vehicles, public health, toxic substances, labor relations and much more.

The agencies have consistently turned down Malamud’s requests for electronic databases containing those rules, which he argues the public is entitled to by law. After years of such runarounds, Public.Resource.Org sued the two agencies Wednesday in Sacramento state court, seeking full access to the records.

The agencies’ response to the organization’s prior requests strained the bounds of absurdity. The Building Standards Commission told Malamud when he requested the state electrical code that it was “not a public record.”

In a Jan. 7 letter, Michael Nearman, the commission’s deputy executive director, informed Malamud that the commission “does not have the publishing rights to [the electrical code] and therefore cannot provide free copies to the public.”

Nearman said the public was welcome to go to any state depository — these are mostly public libraries — and read the code there.

When Malamud asked the Office of Administrative Law to provide an up-to-date electronic version of almost the entire Code of Regulations, it responded that it didn’t have such a version in its possession.

The office said it could provide Malamud with a paper copy of the code’s 38 volumes, at 20 cents a page. There are 29,000 pages. If he required a digital version, the office would scan its own paper copy into a digital file for a much higher, albeit unspecified, price, payable in advance.

Or, the office said, he could use the online version maintained by Westlaw. As Malamud’s lawsuit observes, however, that version is subject to Westlaw’s terms of use.

Those terms say the code may not be “reproduced, duplicated, copied, downloaded, sold, resold, visited, or otherwise exploited for any commercial purpose without the express written consent of Thomson Reuters,” Westlaw’s parent. Those restrictions violate state laws requiring that the material be “publicly available,” according to the lawsuit.

The Building Standards Commission’s assertion that it doesn’t have the publishing rights to the building code rests on a claim by the National Fire Protection Assn., which wrote the model national electrical code from which the state’s version is derived.

Indeed, after Malamud first requested the state code, the NFPA crisply informed the state commission that it held the copyright and wouldn’t authorize the state to distribute the code in PDF format.

To Malamud, that’s stretching the copyright law beyond the breaking point. The California version isn’t identical to the model code; every three years, state officials rework the national code to fit California’s needs and promulgate the result as state law.

State officials “work with 11 different agencies and they amend it heavily,” Malamud says. “What comes out of that is the California Electrical Code.” But because the NFPA has decreed that the code can only be distributed on paper (at $216.50 per copy), California claims its hands are tied.

We’ve written before about how private companies take over taxpayer-funded property for their own profit — most recently, in covering the effort by the University of California to bring down the paywalls blocking access to publicly funded scientific research.

Erecting private obstacles blocking public access to state laws is especially invidious. “Anything incorporated in the law must be available to the people,” Malamud says.

Malamud’s most important battle and most important victory in his campaign to shatter private paywalls protecting public documents concerned the Official Code of Georgia Annotated — that is, the entire body of state law. Malamud started making the Georgia code available for free in 2013. In 2016, the state sued to stop him.

The state argued that, although the laws themselves were in the public domain, that didn’t apply to the annotations, which included synopses of case law, summaries of attorney general opinions and other such derivative material.

Georgia maintained that those items were its copyrighted materials, and that Malamud was infringing its rights as surely as if he had downloaded and distributed a Mickey Mouse cartoon owned by Walt Disney Co. The state called Malamud’s practice of copying and posting state laws and regulations in order to force the states to make them freely available online a “strategy of terrorism.”

The case went up to the U.S. Supreme Court, which last year issued the definitive word on the issue. “The animating principle,” Chief Justice John Roberts wrote for a 5-4 majority, “is that no one can own the law.”

Roberts based his decision on a trio of cases from the 1880s, including one stating that “every citizen is presumed to know the law,” and therefore “it needs no argument to show … that all should have free access.”

Malamud has also faced ferocious challenges from private and industry organizations that write standards for themselves and hand them over to states to incorporate into law.

In a lawsuit brought by more than a dozen such organizations, the federal Court of Appeals for the District of Columbia found in Malamud’s favor.

The organizations’ copyright claims “would enable them to prevent anyone from gaining access to that law or copying it for the public,” Judge Gregory G. Katsas observed in a concurring opinion.

“As a matter of common-sense, this cannot be right,” he wrote. “Access to the law cannot be conditioned on the consent of a private party, just as it cannot be conditioned on the ability to read fine print posted on high walls.” (His reference was to a policy imposed by the Roman emperor Caligula.)

The appellate judges sent the case back down to the federal district court, which had ruled against Malamud, with instructions to think again. He’s still awaiting a follow-up ruling.

Malamud’s campaign for free access to government records began with what has become perhaps the most popular federal records repository — the EDGAR database of corporate filings with the Securities and Exchange Commission.

Malamud won a grant in 1993 to place EDGAR online for free, breaking the near-monopoly then held by the commercial Lexis/Nexis service. SEC staffers, who initially resisted the initiative, soon learned that free access opened the database to a multitude of innovative formats developed by nonprofits and profit-making services, vastly expanding its usefulness.

The battle for more access to more public material still has far to go. The government’s insistence on charging for access to federal court documents through its PACER online database is a major obstacle to public understanding of the judicial system.

A free service known as RECAP allows users to automatically post any court filing or judicial opinion they’ve downloaded to a public server, from which they can be accessed for free. But appeals courts still remain outside RECAP, as do court transcripts prepared by court reporters on contract — the reporters charge fees to make transcripts available. (Indeed, even Roberts carved out an exception for them in his Georgia decision.)

But the basic principle that should govern is that, as Roberts wrote, no one can own the law. The benefits of more access are crystal clear.

“People are more likely to obey the law,” Malamud says, “if they can find it quickly and understand it and use it.”