Private companies cannot demand Aadhaar data linked to an individual's face, fingerprints and iris scans for access to their services, the court said in a 1,448-page verdict. But the 12-digit Aadhaar number has to be linked to citizens' PAN (Permanent Account Number) information for the filing of tax returns, the court ruled.

The court also said Aadhaar is not compulsory for school admissions, for the Central Board of Secondary Education, the University Grants Commission and medical entrance test NEET. "No child shall be denied benefits for the want of Aadhaar," the judges said.

The bench headed by Chief Justice Dipak Misra held that Aadhaar would be voluntary, with an option to exit. "Minimal demographic and biometric data of citizens are collected by UIDAI for Aadhaar enrolment and the system is serving much bigger public interest... We are of the view that there are sufficient safeguard to protect data collected under Aadhaar scheme," it said.

For the exclusion of a "minimal" three per cent, 97 per cent cannot be denied the benefits of Aadhaar, the top court, commenting: "One can't throw the baby out with the bathwater."

No person will be denied benefits under the social welfare scheme because their Aadhaar card cannot be authenticated. But the court also directed the government not to give Aadhaar to illegal immigrants. "As of today, we do not find anything in Aadhaar Act which violates right to privacy of individual citizen," said the court in its verdict on 27 petitions that had challenged the merits of Aadhaar.

"Aadhaar means unique and it is better to be unique than being best. Uniqueness is the fundamental difference between Aadhaar and other identity proofs. Aadhaar cannot be duplicated and it is a unique identification," the judges said.

Justice DY Chandrachud's dissenting judgement held that Aadhaar is not constitutional and passing the Aadhaar law as money bill, thus bypassing the Rajya Sabha, was a "fraud on the Constitution".

The scheme was rolled out under the previous Congress-led government in 2010. It began as a system to provide access to welfare schemes efficiently, but soon evolved into a mandatory ID for access to services like bank accounts, PAN cards, cellphone services, passport and even driving licenses.

Last year, in a case linked to the biometric database, the government went to the Supreme Court to argue that Indians did not have a fundamental right to privacy. It lost the case. The court ruled that the right to privacy was an "intrinsic part of life and personal liberty", which is guaranteed by Article 21 of the Constitution.