Justice is an attempt to address a wrong through the
legal system.
Revenge is a temper tantrum.
I would say revenge is purely done to punish someone. Justice tries to
correct the wrong, sometimes including punishment, but normally as a
deterrent rather than for emotional reasons.
If someone steals your wallet, getting them to give it back is
justice. Hitting them with a baseball bat is revenge.