In 2014, there were just six gun deaths in Japan (≈0.00000004% of the population), compared to 33,599 (≈1.0% of the population) in the US.
Buying a gun in Japan takes patience and perseverance. First, you need to attend an all-day class, then sit a written exam and pass a shooting-range test with a mark of at least 95%. There are also mental health and drugs tests to pass.
Afterwards, your criminal record is checked and police look for links to extremist groups. They even check your relatives and co-workers. Police have the power to deny gun licences and sweeping powers to search and seize weapons. In addition, handguns are banned outright. Only shotguns and air rifles are allowed.
If you're eventually granted a licence, police must be notified where the gun and ammunition are stored—and they must be stored separately under lock and key. Police will also inspect guns once a year. And after three years your licence runs out, at which point you have to attend the course and pass the tests again.