The existing piece on P vs. NP in this category covers the headline question: whether every problem whose solution can be checked quickly can also be solved quickly. NP-hard and NP-complete are two more precise terms that build on that same foundation, and mixing them up is one of the most common vocabulary slips in the whole topic.

A problem is NP-hard if it's at least as hard as every problem in NP — meaning any problem in NP can be transformed into it (a "reduction") without too much extra work. Critically, that definition alone says nothing about whether the NP-hard problem itself is even in NP: it just says it's at least as tough as the hardest problems in that class, and it's allowed to be tougher.

NP-complete adds one more requirement on top: a problem is NP-complete only if it's both NP-hard and also itself a member of NP — meaning a proposed solution to it can still be checked quickly, even if finding that solution in the first place is believed to be hard. That second requirement is what NP-hard alone doesn't guarantee.

A concrete way to feel the difference: the Boolean satisfiability problem (deciding if a logical formula can be made true) is NP-complete — it's in NP, since a proposed answer is easy to check, and it's also proven to be at least as hard as every other NP problem. The halting problem — deciding whether an arbitrary program eventually stops — is NP-hard but not NP-complete, because it isn't even in NP at all: there's no way to quickly check a proposed answer, since verifying it can require running the program forever.

The practical shorthand worth keeping: "NP-hard" is the broader, looser claim ("at least this hard"), and "NP-complete" is the narrower, stricter one ("exactly this hard, and also checkable quickly"). Every NP-complete problem is automatically NP-hard, but plenty of NP-hard problems — like the halting problem — are hard enough to fall outside NP entirely, which is exactly the gap the two terms exist to describe.