Short answer
A 301 is permanent: it tells browsers and search engines the old address has moved for good. A 302 is temporary: it says the old address is still the real one. Use 301 for site moves, https and www changes. Use 302 only when the original will come back.
Free tool for this
The one-line difference
Both send a visitor from one address to another. A 301 says the move is permanent. A 302 says it is temporary and the original address is still the one to remember.
Browsers and search engines treat the two differently, and that choice is what you are really making.
What about 307 and 308
These are the newer pair. 308 is a permanent redirect and 307 is a temporary one, and both keep the request method unchanged, which matters for forms and APIs. For ordinary web pages, 308 behaves like 301 and 307 like 302.
Try it now: Redirect Checker →
When to use a 301
Use it whenever the old address is not coming back: a redesigned site with new URLs, a moved page, a switch to https, a choice between www and non-www, and a domain change.
A 301 is how rankings and links are carried from the old address to the new one.
When to use a 302
Use it when the original will return: a page down for maintenance, a short promotion that points visitors elsewhere, or testing a variation of a page.
The mistake we see most is a temporary redirect doing a permanent job, usually left behind by a plugin or a hosting rule.
Do they affect SEO differently
Google has said it treats a redirect that stays in place for a long time much like a permanent one. But you should not rely on that. A 301 states what you mean, and it removes any doubt about which address should appear in search results.
What really hurts is not the code. It is chains of several redirects, loops, and redirects that end on an error page.
How to check which one you have
Our free redirect checker follows every hop from an address to its final page and labels each as permanent or temporary. Enter a bare domain and it also checks that http, https, www and non-www all end up in one place.