↑↓ to move ↵ to open Esc to close Browse all tools

Hash Generator

Hash text or a file of any size with SHA-256, SHA-384, SHA-512, SHA-1 and MD5, add a secret key for an HMAC, and check a download against its published checksum.

Hash generator

Algorithms
Output
Hashes
  • SHA-256 256 bit
  • SHA-384 384 bit
  • SHA-512 512 bit
  • SHA-1 160 bit Not for security
  • MD5 128 bit Not for security

Your text, files and keys are hashed by your own browser. Nothing is uploaded.

Free printablePrintable Password LogWebsite, username, hint and notes, with an A to Z index for your accounts. Hand-checked listFree Password ManagersFree password manager plans, built-in managers and open source vaults, with the device and sharing limits.

Hash Generator by Freebiefy, free online tools · Privacy · Legal notice

Embed this tool on your site

Paste this code into your page. The tool runs in the visitor's browser, free and without signup. The height adjusts to the content. All tools you can embed

What a hash is

A cryptographic hash function turns any input, a word or a 4 GB disk image, into a short fingerprint of fixed length. The same input always gives the same hash, and changing a single bit gives a completely different one. You cannot get the input back from the hash. To scramble text so it can be read again with a password, use text encryption instead; the guide hashing vs encryption vs encoding sets the three side by side. That makes hashes useful for checking that a file arrived intact, for spotting duplicate files and as a building block of signatures and message authentication.

This hash generator computes five of them at once. SHA-1, SHA-256, SHA-384 and SHA-512 are defined in NIST's FIPS 180-4 Secure Hash Standard; MD5 is defined in RFC 1321. The number in the name of a SHA-2 function is its output length in bits, and each hex character stands for four bits.

AlgorithmBitsHex charactersFor security?
SHA-25625664Yes
SHA-38438496Yes
SHA-512512128Yes
SHA-116040No, checksums only
MD512832No, checksums only

Check a download with its checksum

Many downloads come with a published checksum next to the file. Switch to File, drop the downloaded file and paste the published value into the compare box. The tool finds the matching algorithm by itself and highlights the row. It also reads a whole line from a checksum file, such as the output of sha256sum (hash, then the file name) or the BSD style SHA256 (file.iso) = … line.

If the values differ, the file you have is not the file the checksum was made for. Download it again. Keep in mind that a checksum only helps if it comes from a source you trust: someone who can swap the file on a server can often swap the checksum next to it as well.

On your own computer you can get the same values without a browser. In PowerShell, Get-FileHash file.iso uses SHA256 by default, and -Algorithm SHA1, SHA384, SHA512 or MD5 pick another one (Microsoft documentation). On Linux, sha256sum file.iso from GNU coreutils prints the SHA-256 checksum.

MD5 and SHA-1 are broken for security

For a secure hash it must be practically impossible to find two different inputs with the same output, a collision. Both older algorithms have lost that property. RFC 6151 states that MD5 is no longer acceptable where collision resistance is required, such as digital signatures. NIST announced in December 2022 that SHA-1 should be phased out by December 31, 2030, after collision attacks undermined it, and recommends that anyone relying on SHA-1 for security migrate to SHA-2 or SHA-3.

That does not make them useless. As a checksum that catches a truncated download or a flipped bit on a disk they still work, and Microsoft's documentation for Get-FileHash says the same: MD5 and SHA1 should only be used for simple change validation. Choose SHA-256 for anything an attacker might want to fake, like software releases, certificates and signatures.

Passwords are a separate case. Even SHA-256 is the wrong tool there, because it is fast, and fast means an attacker can test a huge number of guesses. The OWASP Password Storage Cheat Sheet recommends Argon2id, with scrypt as the fallback, and bcrypt only for legacy systems. What NIST asks of the password itself, and of the site storing it, is in how long should a password be.

HMAC: a hash with a secret key

An HMAC, defined in RFC 2104, runs the hash twice with a secret key mixed in. Only someone who knows the key can produce the right value, so the receiver knows the message came from a key holder and was not changed on the way. GitHub, for example, signs every webhook delivery with an HMAC-SHA256 of the payload, sent as a hex value after sha256= in a header. Paste the payload as text, tick HMAC, enter the webhook secret and compare the result with the header. HS256 JSON Web Tokens are signed the same way: RFC 7518 defines HS256 as HMAC using SHA-256.

Enter the key as text, or switch to Hex when it is given as hex bytes, as in the RFC test vectors. A key longer than the hash's block size is hashed first, as RFC 2104 specifies.

Why a hash can come out different

A hash is calculated over bytes, not over what you see on screen. Text is turned into bytes as UTF-8 here, so letters like é or emoji give the same result as any other tool that hashes the UTF-8 bytes. When two hashes of "the same" text disagree, the bytes differ somewhere:

  • A trailing newline. echo writes its text followed by a newline, so echo hello | sha256sum hashes one byte more than the five letters. printf '%s' hello | sha256sum matches this tool.
  • Line endings. Some files end each line with two characters, CR and LF, others with LF alone. A text file and the same text pasted here can differ by those invisible characters. Hash the file itself to be sure.
  • Hex versus Base64. Both show the same bytes. Hex uses 2 characters per byte, Base64 about 1.33. Subresource Integrity attributes, for example, carry a Base64 hash after a prefix like sha384-. The compare box accepts hex, Base64 and that form.

Every algorithm on this page is checked against the published test vectors: the NIST example values for FIPS 180-4, the test suite in RFC 1321 for MD5, and RFC 2202 and RFC 4231 for HMAC.

How to use the hash generator

  1. 1Type or paste text, or switch to File and drop a file. The hashes update as you type.
  2. 2Choose the algorithms and the output format: lowercase hex, uppercase hex or Base64.
  3. 3For a keyed hash, tick HMAC and enter the secret key.
  4. 4To check a download, paste the published checksum into the compare box and look for the green Match.

Frequently asked questions

Is MD5 still safe to use?

Not for security. RFC 6151 says MD5 is no longer acceptable where collision resistance is required, such as digital signatures, and NIST has told everyone relying on SHA-1 for security to move to SHA-2 or SHA-3. Both still work as a quick checksum against accidental damage, which is why many download pages list them. For anything an attacker could tamper with, compare SHA-256 instead.

Why is my hash different from the one my terminal shows?

Almost always because the bytes differ. echo adds a newline at the end, so echo hello | sha256sum hashes six bytes, not five; use printf '%s' hello instead. Different line endings (CR LF instead of LF) and a different text encoding change the bytes too. This tool hashes text exactly as typed, as UTF-8, with nothing added.

Can a hash be decrypted or reversed?

No. A hash is not encryption and there is no key to undo it. But short or common inputs can be found by simply trying candidates, which is why a plain SHA-256 or MD5 of a password is not safe storage. OWASP recommends slow password hashes such as Argon2id, scrypt or bcrypt for that.

What is the difference between a hash and an HMAC?

Anyone can compute the hash of a message. An HMAC mixes in a secret key, so only someone who knows the key can produce or check the value. That proves a message came from a key holder and was not changed, which is how webhook signatures and HS256 JSON Web Tokens work.

Are my files and text uploaded?

No. Everything is hashed by your own browser, and the page sends nothing anywhere. Copy link only shares your settings, such as the algorithms and the output format, never your text, file or key.

How large a file can I hash?

There is no fixed limit. Files are read in 4 MB pieces in a background thread, so even a multi-gigabyte disk image never has to fit in memory. Large files take a while on a phone; you see the progress and can cancel at any time.

Does uppercase or lowercase hex matter?

No. Hex digits A to F and a to f mean the same value, so 9F86D0 and 9f86d0 are the same hash. The compare box ignores case, spaces and colons, and also accepts a Base64 checksum.