Cybercrime — from economic espionage to Target-size heists — costs the world between $375 billion and $575 billion a year, according to an analysis by former U.S. officials and economists.

The study, conducted by McAfee and the Center for Strategic and International Studies in Washington, offers a comprehensive look at how cyberattacks cut into the world’s gross domestic product.

At current levels — between about .5% and .8% of global GDP a year — hacking has become a cost of doing business that falls between maritime piracy (.02%) and counterfeiting (.9%), according to the study.

Many companies view those levels as acceptable.

“Companies expect shoplifting, so they build it in,” said James Lewis, who has advised Washington officials on cybersecurity and who helped write the report for CSIS. “In interviews with some companies, that’s how they view cyber.”

Lewis and his colleagues concede that putting an exact number on damages from cyberattacks is nearly impossible. Companies don’t always disclose if they’ve been hit by a breach — either because they don’t know or because they fear the negative publicity.

To arrive at the $575 billion top-end figure, the team consulted economists, intellectual-property lawyers and government officials in countries that keep data on cyberattacks. Most only keep partial records, Lewis said. “If you’re not measuring, how do you know?” he said.