Justice describes the rightness, correctness, or morality of an action, circumstance, or cause. Random House Dictionary gives us the example phrase, "to uphold the justice of a cause," meaning that if we believe in a cause as being correct, such as protecting the environment, then we defend the cause's rightness, correctness, and moral necessity. Justice, however, can also refer to the law in as much as the actions that uphold the law are right, correct, and moral. Finally, we can also use justice to refer to punishment. For example, if someone breaks a law, then we feel it is just, meaning correct, right, and moral, to punish that person in order to correct that person's behavior for the future.
Mercy is especially defined as showing "compassion, pity, or benevolence" towards one who has committed a wrong, meaning showing sincere sympathy, regret, and kindness towards those who have committed a wrong or are suffering (Random House Dictionary). Random House Dictionary gives the example sentence, "Have mercy on the poor sinner," meaning take pity and show kindness towards the sinner, or transgressor.
Victor Hugo's novel Les Misérables is an excellent literary example that portrays definitions of both justice and mercy. In fact, a dominant thesis in Les Misérables is that mercy must be shown in all circumstances and also that mercy stands above the law, or justice. The Bishop of Digne shows the hero of the story, the ex-convict Jean Valjean, mercy when he steals the Bishop's silver, giving him the silver as a gift instead, which enables Valjean to redeem himself and begin a life of generosity and virtue instead. We also see Hugo portray mercy as having a greater value than justice with respect to the character Inspector Javert. Javert is a man who was raised in a prison and grew up believing that the law is the ultimate ruler. Not only that, he believes that criminals are incapable of being anything but criminals, therefore, why show them mercy? However, the criminal Jean Valjean shows Javert, who has been pursuing Valjean to re-arrest him all throughout the novel, mercy when Valjean frees Javert from the French revolutionary insurgents, rather than allowing Javert to be shot as a spy. The result is that later Javert feels compelled to show Valjean equal mercy rather than handing him over to the authorities as a fugitive. However, this shakes every fiber of Javert's being because he has lived his life believing that the law, that justice, is the highest form of morality, but now he is forced to see that mercy can stand above the law and even trump it. As Hugo writes:
To deliver up Jean Valjean was bad; to leave Jean Valjean at liberty was bad. In the first case, the man of authority fell lower than the man of the galleys, in the second, a convict rose above the law, and set his foot upon it. In both cases, dishonor for him, Javert. (Vol. 5, Bk. 4, Ch. 1)
The result is that Javert commits suicide because he simply cannot live with the notion that something stands above the law, which perfectly portrays Hugo's thesis that mercy stands above justice.