Bryan Galloway, 31, from Kilwinning, admitted robbing Premier Stores in the North Ayrshire town on 14 October 2015 and making off with Â£300.
He also admitted attempting to rob Caley Stores in the town the next day.
At the High Court in Glasgow, judge Lady Scott told Galloway he would be monitored for two years after his release due to the risk he posed.
A man who wore a "Scream" mask while robbing two shops at knifepoint has been jailed for four years.