Hooper has put pen to paper on a one-year deal with the option of a further 12 months.
The 19-year-old previous played junior football in Kent prior to joining the Magpies, who released him this summer.
He had work experience spells at Darlington and Workington ahead of the move to Sixfields.
Cobblers boss Aidy Boothroyd said: "JJ is a very talented individual. He has come from a big Premier League club but has maybe got lost in the system a little bit.
"We are giving him an opportunity to make a name for himself and to get his career going.
"He has an awful lot to do and a lot to learn but he has potential. How well he does and how far he goes is down to JJ.
"I expect him to be challenging for a first-team place towards the end of the season."