As you've discovered, there are different ways to determine what ASN an IP address is associated with. In general, you can look in three places:
Real-time (or historic) BGP (global routing) data
Routing Registry records
IP allocation / assignment records
Also, to add confusion, there can be several origin ASNs in #1 and overlapping records in #2. It's possible to overlapping in #3, but less likely as long as you stick to the most specific.
The difference in results you are experiencing is a combination of:
where you (or your tool is) looking things up
if there is overlap ...and if so, what your tool does to decide which one to display
Where to look?
Depends. The most accurate of what's live in the wild is BGP itself (#1). Just keep in mind it can change. The first link you provided is based on a snapshot from BGP. You can use a looking glass for real-time information from a particular network's perspective.