SHA512 Encrypt / Decrypt

Four jobs in one tab: hash text, sign a message with a secret key, check a value against a digest someone published, and fingerprint a file. Nothing is uploaded. Read the section under the console before you go looking for a decrypt button, because SHA-512 does not have one.

SHA-512 hashing and HMAC console

Output updates as you type. The input encoding row tells the hasher how to read your characters, so the same text hashes to three different digests depending on which button is lit.

Input
Output

HMAC mixes a secret key into the digest, so only someone holding the key produces a matching tag. Any key length works. Anything past 128 bytes gets hashed down first, which is part of the standard rather than a shortcut taken here.

Paste what you believe the original text was and the digest you were given. The comparison is case insensitive and expects 128 hex characters. A Base64 digest will not match here, so convert it first.

The file is read into memory in the tab and hashed there. Good for an installer or an archive you want to match against a SHA512SUMS line. Multi gigabyte files belong on the command line instead.

Output64 bytes
SHA512 hash will appear here…

SHA-512 has no decrypt, and the sites offering one are reading from a list

Encryption keeps the original around in scrambled form, waiting for a key. SHA-512 does not. It reads your input, mixes it through 80 rounds, and hands back 64 bytes. A one line email and a 4 GB disk image both come out as the same 128 hex characters, so the original cannot be sitting inside the digest. Reversing it would mean recovering the disk image from 64 bytes.

Type password into a site advertising SHA-512 decryption and it returns password within a second. Type a passphrase your team invented last Tuesday and it returns nothing at all. The difference tells you exactly what happened: the first value was already in a precomputed table, and the second was not. No maths was reversed either time.

What people usually mean by decrypt

Almost every visitor arriving on a "SHA512 decrypt" search wants one of three things, and each has a real answer.

What you are trying to doThe working approachWhere on this page
Check whether a password matches a stored digestHash the candidate and compare the two digests. This is what every login system does, since none of them recover the stored password either.Verify tab
Confirm a download was not alteredHash the file and match it against the digest the publisher listed.File tab
Protect a payload so only a keyholder reads itYou want encryption, not a hash. AES with a key you control does this. A digest never comes back.Encryption and Decryption tool

A fourth case turns up in support tickets: someone inherited a database of SHA-512 password digests and wants the plaintext back. The answer there is a migration, not a recovery. Rehash on next login into bcrypt or Argon2 and keep the old column only long enough to catch stragglers.

Why the lookup sites work at all

SHA-512 is deterministic, so hunter2 produces the same digest on every machine, every time, forever. Someone hashed a few billion common strings once and stored the pairs. A lookup site queries that table. It breaks nothing about the algorithm, and it stops working the moment your input is unusual.

Salt kills the table

Store sha512(salt + password) with a distinct random salt per user and the attacker's precomputed table is worthless, because they would need one table per salt. This is why every password scheme since the 1970s stores a salt beside the digest.

Speed is the other half

Salt stops precomputation but not brute force. A consumer GPU runs billions of SHA-512 operations per second, so a salted six character password still falls in minutes. Slow hashes exist to remove that advantage.

HMAC-SHA512 is the part that behaves like a key

The HMAC tab is the closest thing here to what people picture when they say encrypt with SHA-512. Feed it a secret and a message and the output changes completely if either one changes by a byte. Anyone without the secret cannot produce a matching tag, even knowing the full message.

Two details about the key trip people up when they compare output across languages:

Webhook signatures are the common use. Stripe, GitHub, and most payment providers sign the raw request body with HMAC and put the tag in a header. Paste the exact body and your signing secret here to see whether your handler is reading the same bytes the sender signed. A mismatch is usually a framework that reparsed and re-serialized the JSON before your code touched it.

The encoding row changes the answer

The Input row above is not cosmetic. It decides what bytes the hasher receives.

Take 4142. Read as UTF-8 it is four characters, the digits 4, 1, 4, 2. Read as Hex it is two bytes, A and B. Two different inputs, two unrelated digests. Switch the Input row between UTF-8 and Hex with 4142 in the box and watch the output change entirely.

This is behind most reports of a digest not matching between a browser tool and a backend. The backend hashed decoded bytes while the browser hashed the printable text of those bytes, or the other way around. Match the encoding before you suspect the algorithm.

The Output row is a formatting choice made after hashing, so the underlying 64 bytes are the same either way. Hex gives 128 characters, Base64 gives 88 including the two padding marks. Base64 is what appears in HTTP headers and JWT related fields where length matters.

Checking a file against a published digest

Project release pages list digests so you can tell a mirror served the real file. Drop the download into the File tab and compare visually, or use the command line, which is faster for anything past a few hundred megabytes:

sha512sum ubuntu-24.04.iso shasum -a 512 ubuntu-24.04.iso # macOS certutil -hashfile ubuntu-24.04.iso SHA512 # Windows

One warning about this check. A digest fetched from the same page as the file proves the transfer was not corrupted, and nothing more. Whoever replaced the file could replace the listed digest on the way past. Signed checksum files, where a GPG signature covers the SHA512SUMS file, are what turns a corruption check into a tamper check.

Matching this page in your own code

All three snippets produce the same 128 hex characters as the Hash tab with UTF-8 input:

// PHP $digest = hash('sha512', $text);$tag = hash_hmac('sha512', $body, $secret);$file = hash_file('sha512', '/path/to/archive.tar.gz');if (hash_equals($tag, $headerValue)) { }# Python import hashlib, hmac digest = hashlib.sha512(text.encode()).hexdigest()tag = hmac.new(secret.encode(), body.encode(), hashlib.sha512).hexdigest()if hmac.compare_digest(tag, header_value):pass # trusted

Shell users hit one reliable trap. echo appends a newline, so the digest below is of abc\n rather than abc, and it will never match what you typed into the box above:

echo abc | sha512sum # hashes 4 bytes: a b c \n printf %s abc | sha512sum # hashes 3 bytes, matches this page

Both hash_equals and compare_digest exist for a reason worth knowing. A plain == on strings stops at the first differing character, so the time it takes leaks how many leading characters were correct. Against a remote attacker probing a signature, that timing is enough to rebuild the tag byte by byte. The comparison in this page is a plain string check, which is fine in a browser where you are checking your own data, and wrong in a server handling untrusted input.

Do not store passwords as a bare SHA-512

SHA-512 was designed to be fast. That is the correct goal for verifying a Linux ISO and the wrong one for storing a password, because speed belongs to the attacker as much as to you. Current hardware runs SHA-512 at billions of guesses per second against a leaked table, and a salt does not slow that down.

Use bcrypt, scrypt, or Argon2id. All three are deliberately slow, take a work factor you raise as hardware improves, and handle salting themselves. In PHP that means password_hash($pw, PASSWORD_DEFAULT) and nothing more.

One source of confusion: the $6$ entries in /etc/shadow on Linux are labelled SHA-512, and they are not a plain digest. That format is 5000 rounds of SHA-512 with a salt, a scheme from 2007. Hashing a password once here will never reproduce a $6$ line.

Where this page stops

Everything runs in the page through the CryptoJS library loaded with it. No text, key, or file leaves your machine, which the network panel will confirm while you hash. The library itself is fetched from a CDN when the page opens, so the first load needs a connection and the hashing afterwards does not.

Questions people ask after the decrypt button fails to appear

Mismatched digests, HMAC tags that will not line up, and where SHA-512 belongs.

Can SHA512 be decrypted with the right tool?

No. SHA-512 compresses any input to 64 bytes, so the original is not stored in the output and there is nothing to reverse. Sites claiming otherwise look your digest up in a table of precomputed common strings. They return a result for password and for 123456, and nothing for a value nobody has hashed before. If you need the original back, you needed encryption rather than a hash.

Why does my digest differ from what my server produces for the same text?

Three causes cover almost every case. A trailing newline from echo or from a file that ends with one, a character encoding difference where the server read UTF-16 or Latin-1, or the Input row on this page set to Hex or Base64 while your code hashed the literal text. Check the input length stat above against the byte count your server reports. If those two numbers differ, the bytes differ and the algorithm is fine.

Is SHA-512 stronger than SHA-256?

It has a longer output, which raises collision resistance from 128 bits to 256 bits, and both are far past what anyone can attack today. The practical difference is elsewhere: SHA-512 works on 64 bit words, so it often runs faster than SHA-256 on a 64 bit CPU while producing twice the output. On 32 bit embedded hardware the ordering flips. Pick based on what the other side expects rather than on a strength ranking.

What length should my HMAC key be?

At least 32 random bytes, and 64 matches the digest size if you want the theoretical maximum. Anything longer than 128 bytes gets hashed to 64 by the standard before use, so a very long secret buys nothing. What matters more than length is randomness. A key from a password manager or from a crypto random generator, not a phrase someone typed.

My webhook signature check fails even though the secret is right. What now?

Sign the raw request body, not a reparsed version of it. Most frameworks decode JSON and hand your code an object, and re-encoding that object changes key order and whitespace, which changes the tag. Capture the raw body before any middleware touches it. Also confirm whether the provider signs the body alone or a string built from a timestamp plus the body, since several prepend a timestamp with a separator.

Can two different inputs produce the same SHA-512 digest?

By counting alone, yes, because there are infinite inputs and 2^512 outputs. Finding such a pair is the problem. No collision has been produced for SHA-512 or for full SHA-2 at all, and the best known attacks reach only reduced round variants. Compare that with MD5, where collisions are generated on a laptop in seconds, and SHA-1, broken in practice in 2017. Neither belongs in anything current.

Why do the hex and Base64 outputs look nothing alike?

They are two spellings of the same 64 bytes. Hex uses 16 characters and spends two per byte, giving 128 characters. Base64 uses 64 characters and packs three bytes into four, giving 88 characters with padding. Convert either one and you land on the identical bytes. Base64 turns up in HTTP headers and configuration files where the shorter form is preferred.

Does hashing here send my file or my secret anywhere?

No. The hashing happens in the page script and there is no request in that path. Open your network panel and press Generate to confirm. The CryptoJS file loads from a CDN when the page opens, so the page needs a connection to start. Worth remembering separately: a secret pasted into any browser tab has passed through your clipboard, so rotate production keys you test with here.

What is SHA512 actually used for in production?

File and package integrity checks, HMAC signing on APIs and webhooks, the hash step inside signature schemes such as RSA-PSS and Ed25519, git object naming in repositories that have moved off SHA-1, and blockchain work. Notably absent from that list is password storage, which belongs to bcrypt and Argon2 for reasons of deliberate slowness.