Andrew Collier, 27, of Range Way, Kingsbury has been jailed for six months for punching a police officer and attempting to headbutt another on 19 December.
The officers were attacked after they responded to a report Collier had walked into a shop in Mill Crescent, Kingsbury with a claw hammer and a mallet.
He pleaded guilty to two counts of assaulting a police officer and two counts of possession of an offensive weapon in a public place.
Chief Superintendent Ben Smith, head of local policing, said: “Officers are often subjected to abuse and violence. It is not simply part of the job, it is unacceptable and we will not tolerate it.”