Alex Gaddass, from Westborough, appeared at York Crown Court via video link on Friday when he pleaded guilty to the knifepoint robbery, which occurred at the Premier shop on North Marine Road on April 25.
Gaddass, who had been remanded in custody following his arrest, also admitted carrying a blade.
The victim of the robbery was a named man whom Gaddass robbed of about £250 cash.
Police were called to the scene at 7pm and said staff were left “understandably shaken but were not hurt”.
Gaddass and another suspect, a local man in his 30s, were arrested about two hours later.
The court heard that Gaddass had two previous convictions – one for carrying a blade.
Graham Parkin, for Gaddass, asked for sentence to be adjourned for the preparation of a psychiatric report.
Recorder Patrick Palmer postponed sentence until July 30 but told Gaddass: “Inevitably, you will be receiving a custodial sentence.”