What is the difference between justice and equality?

Sometimes ‘justice’ is confused with ‘equality’ and it seems that the meaning of justice is that ‘equality should be maintained’, whereas this is not so. Equality is not a condition for justice. Rather, rights and priorities must be considered.

As an example, justice in a classroom of students is not that they all receive equal grades and justice between two workers is not that they receive equal wages. Rather, justice is for each student to be graded according to his knowledge and ability and each worker to be judged according to his work and activity.

In the world of nature, also, justice in the extensive sense means just this. If the heart of a whale, which weighs one ton, be compared to the heart of a sparrow, which is perhaps not more than one gram in weight, if they were equal, there would be no justice and if the roots of a very tall tree were equal to the roots of a small plant, this is not justice and is equivalent to oppression.
Justice is that every creature receives its rights in proportion to its abilities.

Ref: Fifty Lessons of Principles of Belief for Youths; Ayt. Makarem Shirazi; Translated by: Bahador Shirazian; Published by: Ahlul Bayt World Assembly