MD5 produces a 128 bit hash, written as 32 hex characters. SHA-1 produces 160 bits, 40 hex characters. SHA-256, the most common member of the SHA-2 family, produces 256 bits, 64 hex characters. The pattern is simple: the longer the output, the more possible values exist, and the harder it is for two different inputs to collide on the same hash. For a rough sense of scale, a 128 bit space has about 3.4 times 10 to the 38 possible values, and 256 bits squares that already astronomical figure. The hash length tool here shows the exact sizes in bytes and Base64 too, which matters when you are storing hashes rather than just admiring them.
Broken in hash language means collisions can be found faster than brute force, not that hashes can be reversed. MD5 collisions have been practical since the 2000s and were famously used by the Flame malware to forge a Microsoft signature, so MD5 must never be used where an attacker might craft inputs. SHA-1 fell in 2017 when researchers produced two different PDFs with the same hash, and browsers had already stopped trusting it for certificates. Both algorithms still detect accidental corruption perfectly well, and MD5 remains common for checking that a download was not garbled. SHA-256 has no practical attacks and is the default recommendation for integrity, signatures and most security duties today.
For verifying downloads and files, use whatever the publisher offers, ideally SHA-256; the point is comparing your computed hash with theirs. For storing passwords, none of these three is the right tool on its own: passwords need slow, salted algorithms such as bcrypt or Argon2, because fast hashes let attackers test billions of guesses. For new systems, reach for SHA-256, or SHA-512 where 64 bit machines make it faster, and SHA-3 if you want a design unrelated to SHA-2 as insurance. Avoid inventing combinations like double MD5 for strength; composition rarely helps and often hurts. The real rule is boring and safe: standard algorithms, current versions, no improvisation. One more distinction that saves confusion: a checksum and a security hash do the same maths with different promises. A checksum says this probably was not garbled on the way. A security hash says nobody could have altered this deliberately without detection. MD5 still honours the first promise and broke the second years ago. Before trusting a hash, ask which promise you need. The tool below covers the sizes for the algorithms behind both, so you can at least confirm you are comparing the right length of string.