All five algorithms follow the same shape. The text is converted to UTF-8 bytes, a single 0x80 byte and then zeros are appended until the length is just short of a block boundary, and the original length in bits is written into the space left: eight bytes before a 64-byte boundary for MD5, SHA-1 and SHA-256, sixteen before a 128-byte boundary for SHA-384 and SHA-512, which work on 64-bit words. The result is processed one block at a time through a compression loop, and the internal state left at the end is the digest. Because the padding rule is part of the specification, two implementations that follow it produce identical output — which is the entire reason a checksum is useful to anyone but its author.
These are implemented as plain arithmetic on this page rather than handed to the browser's built-in crypto API, for three reasons. Web Crypto deliberately has no MD5, and MD5 is what most people arrive here needing. Web Crypto is asynchronous, while every other tool on this site is a synchronous function shared between the browser and the API. And Web Crypto only exists in a secure context, so it disappears in environments where plain arithmetic still works. The trade-off is speed, which for text-sized input is not noticeable.
On choosing between them: MD5 and SHA-1 are broken for any security purpose. Chosen-prefix collisions against both are practical and have been demonstrated against real certificates, so neither should be used to prove that a file is the file you expect when someone might be trying to fool you. They remain perfectly good at detecting accidental corruption, which is why package registries still publish MD5 checksums. Use SHA-256 or longer whenever an adversary is part of the threat model. SHA-384 is SHA-512 started from different initial values and cut short, which has a useful side effect: the output does not reveal the whole internal state, so it is not open to the length-extension attack that applies to SHA-256 and SHA-512 used naively as a MAC. And note that no hash is encryption: there is no key and no way back to the original text.