{"copy":{"explain":"A hash function turns any amount of data into a short fingerprint of fixed length. The same input always gives the same hash, and changing even one letter gives a completely different one. The tool reads your text as UTF-8 bytes (or the file exactly as it is), works out MD5 with its own code and the SHA family with your browser's built-in Web Crypto, and shows each result in hexadecimal. With a secret key it makes HMACs instead, which prove that the data came from someone who knows the key.","example":"The text &quot;hello&quot; → MD5 5d41402abc4b2a76b9719d911017c592, SHA-256 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824. Change it to &quot;Hello&quot; and both hashes change completely.","intro":"Make MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes of any text or file, or HMACs with a secret key, and check a hash against a file.","sections":[["What is a hash?","A hash (or checksum, or digest) is a short code worked out from data by a fixed rule. It is like a fingerprint: the same file always has the same SHA-256, but you cannot get the file back from the hash. That makes hashes useful for checking that a download is complete and has not been changed, for spotting duplicate files, for storing passwords safely (with special slow hash functions), and inside digital signatures, Git commits and blockchains."],["How to check a downloaded file","Many download pages (Linux images, Android ROMs, software installers, government forms) list a SHA-256 or MD5 next to the file. Choose File, pick the downloaded file, and paste the published hash in the compare box. If it says it matches, the file is exactly what the publisher made. If it does not match, the download is broken or the file has been changed: download it again from the official site."],["Which algorithm should I use?","Use SHA-256 for anything new: it is the standard for file checks, APIs and certificates, and no one has found a way to fake it. SHA-512 is just as safe and sometimes faster on 64-bit computers. MD5 and SHA-1 are still fine for spotting accidental changes, like a broken download, but people can deliberately make two different files with the same MD5 or SHA-1, so never use them for security."],["What is HMAC?","HMAC is a hash mixed with a secret key. Only someone with the key can make the same HMAC, so it proves both that the data was not changed and who sent it. Payment gateways like Razorpay and Stripe, and webhooks from GitHub and Shopify, sign their messages with HMAC-SHA256. Turn on HMAC, type the key, and paste the message body to check a signature while you build or test an integration."],["Hash lengths at a glance","MD5: 128 bits, 32 hex characters. SHA-1: 160 bits, 40 characters. SHA-256: 256 bits, 64 characters. SHA-384: 384 bits, 96 characters. SHA-512: 512 bits, 128 characters. The compare box uses the length to tell you which kind of hash you pasted."],["Hashes in everyday tools","Git names every commit by its SHA-1 (moving to SHA-256). Bitcoin addresses and blocks use SHA-256. Docker images are named by SHA-256 digests. Package managers like npm and pip check downloads with SHA-512 and SHA-256. UPI, banks and payment gateways sign requests with HMAC-SHA256."]],"faqs":[{"q":"Can a hash be decoded back to the text?","a":"No. A hash is one-way: it throws information away, so the original cannot be worked out from it. Websites that &quot;decrypt&quot; MD5 only look the hash up in huge lists of common words and passwords, which is why short or common passwords are easy to find."},{"q":"Why does my hash not match the one from my code?","a":"Usually the input is slightly different: a new line at the end, a space, Windows line endings (\\r\\n), or a different text encoding. This tool hashes the exact UTF-8 bytes of what is in the box. In code, make sure you hash the same bytes, and compare in the same letter case (hex is not case-sensitive)."},{"q":"Is MD5 still safe?","a":"Not for security. Since 2004 people have been able to make two different files with the same MD5, and SHA-1 was broken the same way in 2017. They are still fine for checking a download for accidental damage, but use SHA-256 or SHA-512 for signatures, certificates and anything an attacker might want to fake."},{"q":"Should I store passwords as SHA-256?","a":"No. Plain SHA-256 is too fast, so an attacker can try billions of guesses a second. Passwords should be stored with a slow password hash such as bcrypt, scrypt or Argon2, with a random salt for each user. Use this tool to understand and check hashes, not to store passwords."},{"q":"Is what I paste sent anywhere?","a":"No. Text and files are hashed on your device. Everything runs in your browser on your own phone or computer, and nothing is sent to our servers or saved."},{"q":"Is the Hash Generator free?","a":"Yes. There is no sign-up, no limit and nothing to install. It also works offline once the page has loaded."}]},"feat":[["5 hashes at once","MD5, SHA-1, SHA-256, SHA-384 and SHA-512."],["Files too","Check a download against its published hash."],["HMAC","Sign with a secret key, like webhooks."]],"faqx":[{"q":"What is the SHA-256 of an empty text?","a":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855. The MD5 of an empty text is d41d8cd98f00b204e9800998ecf8427e. If you see these, the input was empty."},{"q":"How do I check a file's hash on Windows, Mac or Linux?","a":"On Windows, open PowerShell and run Get-FileHash file.iso (SHA-256 by default). On a Mac, run shasum -a 256 file.iso, and on Linux sha256sum file.iso. The result should be the same as here."},{"q":"Are uppercase and lowercase hashes the same?","a":"Yes. Hex digits a to f can be written in either case, so 5D41… and 5d41… are the same hash. Turn on UPPERCASE if a system needs capitals; the compare box ignores the case."},{"q":"Can two files have the same hash?","a":"In theory yes, because there are endless files and a fixed number of hashes, but for SHA-256 the chance of it happening by accident is so tiny that it is treated as impossible. For MD5 and SHA-1, people can make it happen on purpose."}]}