What a hash is and what it is for
A hash function takes data of any size and returns a fixed-size fingerprint: 32 hexadecimal characters for MD5, 64 for SHA-256. Three properties make it useful: the same data always gives the same fingerprint, a tiny change in the data changes the whole fingerprint, and the data cannot be rebuilt from the fingerprint. With that you can check a download arrived intact, store passwords without storing the password, and sign a document by signing only its fingerprint.
What a hash is not: encryption. There is no key and no way back. What can be done is trying candidates — millions per second — until one produces that fingerprint, which is why passwords are stored with a salt and with deliberately slow functions, not with a bare MD5.
MD5, SHA-1 and SHA-2, one by one
MD5 (1992) gives 128 bits. Collisions — two different inputs with the same fingerprint — have been known since 2004 and are produced in seconds today, so it is no good for signing or for passwords. It is still useful for spotting accidental corruption in a download, which is what most people look it up for.
SHA-1 (1995) gives 160 bits. It met the same fate in 2017, when the first practical collision was published; browsers stopped accepting certificates signed with it that same year. SHA-256, SHA-384 and SHA-512 are the SHA-2 family (2001), with no practical attacks known, and are what is used today: SHA-256 for almost everything, SHA-512 where the processor is 64-bit and the data large, because it is faster there.
How to verify a download
Whoever publishes a large file — a system image, an installer — usually publishes its hash
next to it. After downloading, you compute the hash of the file you received and compare it
with the published one: if they match, the file is identical bit for bit; if not, something
changed on the way, whether a dropped connection or something worse. This page hashes a
text; for a file, on Windows it is certutil -hashfile file SHA256, on macOS
shasum -a 256 file and on Linux sha256sum file.
The “compare with” field does that check for you: paste the published hash and the page says whether it matches any of the five, so you do not have to read sixty-four characters by eye. Case does not matter; neither do spaces.
Worth knowing
The hash is computed over bytes, not characters, and the same text can have different
bytes depending on the encoding: “café” is five bytes in UTF-8 and four in Latin-1, with two
hashes that look nothing alike. This page uses UTF-8, which is what nearly everything uses
today; if a published hash does not match yours and the text has accents, the encoding is
the first thing to check. A trailing newline counts too: echo adds one, and it
is the most common reason a hash computed in a terminal does not match the one here.
Everything is computed in your browser with the cryptographic API it ships with — MD5 is not in it and is written by hand, checked against the standard’s test vectors. Nothing is sent anywhere.