Shaun McKerry tried to rob Shildon Post Office in County Durham on 15 March.
CCTV showed the 31-year-old threatening staff with the axe before shopkeeper Sab Dhillon tackled him to the floor and restrained him.
Durham Crown Court heard McKerry, of Coundon, near Bishop Auckland, had earlier admitted attempted robbery.
McKerry, whose face was hidden by a scarf and hood, brandished the weapon as he ordered shop assistant Andrea Brighty to fill a bag with money from the till, the court heard.
But Mr Dhillon ran from a back office, grabbed McKerry from behind and wrestled him to the floor.
The court heard McKerry, dubbed Boomerang Boy because of his repeated spells in prison, had been arrested more than 80 times.
He was told he must serve an extended four-year licence period after he is released.
The court was told McKerry started shoplifting at the age of 12 and by 15 he had been arrested 80 times, and had convictions for aggravated vehicle-taking, sending indecent letters, and burglary.
McKerry once stole 22 charity boxes while dressed as a woman, and locals dubbed him a one-man crime wave.
Dramatic CCTV footage from the shop showed the masked McKerry waving an axe as he demanded cash from terrified assistant Andrea Brighty.
But he did not see Mr Dhillon's rugby tackle, which dropped him to the floor, sending shelves and produce tumbling.
As the men wrestled, and with McKerry still holding the axe, Mr Dhillon's wife Sam helped, hitting him twice with a baseball bat to make him drop the weapon.
Blood can be seen coming from the would-be robber's nose and Mr Dhillon gestured to his wife to drop the bat.
Minutes later the police arrived and arrested McKerry, who, the court heard, had been arrested more than 80 times and had 64 previous convictions.
Speaking to BBC Tees shortly after the raid, Mr Dhillon said: "I was in the back storeroom on the computer and I heard Andrea, who was behind the counter shouting 'no, no, no'.
"I saw a guy waiving an axe at her. I came up behind him and pulled him away from Andrea and the counter. We struggled, fell on the floor.
"I managed to keep hold of him and get the axe off him and hold him there until the police arrived."
During his summing up in court, Judge Christopher Prince described Mr Dhillion's actions as a "conspicuous display of bravery."
The court was told McKerry's history of offending also included burglary, assaulting a police officer, attempted robbery and criminal damage.
A serial criminal who was brought to the ground by the owner of a shop during a failed axe raid has been jailed for six years.