The 22-year-old made his debut in 2011 but has found himself behind Juwon Oshaniwa this season following the Nigeria international’s arrival.
McHattie has been restricted to just three appearances this campaign, two of those in the League Cup including scoring in the 2-1 win over Forfar.
McHattie, who made his debut aged 17, was under contract at Tynecastle until next summer.
And the young defender said he will leave with fond memories of his time at the Scottish Premiership side.
“I’ve loved every minute here, it’s been fantastic. I’ll leave here with some great memories, not least winning the title last year,” he told Hearts News. “I’ll miss this place, no doubt about that.
“It’s time for a new challenge now and I’m looking forward to getting first team football. But for now I’d like to take the chance to thank the staff, my team-mates and the fans for all their support.”
Meanwhile, Hearts have lodged an appeal against Callum Paterson’s New Douglas Park red card.
Paterson was shown a straight red after a strong sliding challenge on Hamilton midfielder Darian MacKinnon, but footage showed he got the ball.
Hearts head coach Robbie Neilson revealed after his side’s 3-2 Ladbrokes Premiership defeat that he had prepared for playing with 10 men after seeing referee Willie Collum and his team were in charge of the game.