Fanon is a so-called "fact" that a fan thinks is true, but for which there is no evidence in any official material. A piece of fanon may be a belief held by just a single fan, or a belief which is widespread due to having been discussed and picked up by other fans.
Headcanon is a slang term for a fan’s personal, unofficial interpretation or belief about a fictional story, character, or universe that is not confirmed by the source material. It fills in gaps, imagines backstories, or interprets character traits, often sharing these ideas within fan communities