Fundamentally, a URL is merely an address. There are plenty of useful, meaningful conventions that you can use to decipher what they might contain, but when it comes down to it, a webserver is free to return any type of thing it wants for a given URL. Not even querying the server, asking for what comes back, and examining it is a 100% surefire way of knowing what sort of file it is. The server could easily change what sort of file it points to based on the request, or the time or day, or the whims of its owner.
There are some good basic guidelines that will work most of the time, but I hesitate to even mention them because they're absolutely not reliable.
There is some good news, though. If you actually request the data from the server, it will, just as some other answers point out, tell you precisely what sort of thing it is providing you with (for this particular exchange). It'll give you a MIME-Type in the field named "Content-Type". If it's text/html, then you have yourself an html document (not an image, not an xhtml document, HTML).