Porcupines are larger. They are native to the Americas, south Africa, and Asia. Porcupines are herbivores.
Hedgehogs are fairly small and, depending on species, are native to New Zealand, Europe, Asia, or Africa. They have small quills that are not meant to be lost, unlike the porcupine which can leave barbed quills in predators and ignorant humans. Hedgehogs have also been domesticated. Hedgehogs are insectivores.
Both animals are pretty docile but porcupines have quills and prefer to be left alone. Hedgehogs make decent pets but porcupines dont. Porcupines are docile little creatures and they wont hurt you unless they are threatened. If threatened they will shoot their quills. They will hurt... but they wont kill you.