Buhari granted the pardon when he arrived at the place in company with the state Gov. Abdullahi Ganduje and others.
The News Agency of Nigeria (NAN) reports the president was on a two-day official visit to Kano State.
The prisoners include males and females.
The president advised the affected inmates to be of good behaviour and shun anything that could bring them back to prison.
He charged them to engage in lawful ventures to enable them to become useful members of the society.
The president also gave the inmates an undisclosed amount of money to transport themselves to their respective homes.
In his remarks, Ganduje also advised the inmates to conduct themselves well and contribute meaningfully to societal development.
NAN reports that Buhari earlier visited the Emir of Kano, Alhaji Muhammadu Sanusi II.