According to the most recent edition of the Small Arms Survey, there were an estimated 857 million firearms in civilian hands worldwide in 2017, along with a further 133 million in the possession of militaries and 22.7 million controlled by law enforcement. The research notes that it is difficult to estimate the number of firearms in circulation with absolute certainty and it relied on a variety of available data sources including published official documents and research studies, official responses to questionnaires, public opinion surveys and correspondence with experts.
The United States has the most civilian-held and illicit firearms by far and it actually has more guns than people. The research estimates that the U.S. had 393.3 million civilian and illicit firearms in 2017 - 120.5 for every 100 of its residents. How does that compare with other countries? India has a population of 1.35 billion but it comes a distant second to the U.S. with 71.1 million civilian/illicit guns. China, the world's second most populous country, comes third in the ranking with 49.7 million, followed by Pakistan (43.9 million) and Russia (17.6 million).