Skip to content

SHA-512 Hash Generator - Generate SHA-512 Hashes Online

SHA-512 Hash
—

Generate a SHA-512 Hash

Type or paste text and the 128-character SHA-512 digest appears below. The input is encoded as UTF-8 and hashed with the browser's Web Crypto API, so it matches printf '%s' "text" | sha512sum and hashlib.sha512(text.encode()).hexdigest(). Nothing is uploaded.

Where You See SHA-512

  • npm and Yarn lockfiles. Every package in package-lock.json has an integrity: "sha512-..." field: the Base64 SHA-512 of its tarball. npm refuses to install a package whose hash does not match.
  • Linux password hashes. Entries in /etc/shadow that start with $6$ use SHA-512 crypt: a random salt and 5,000 rounds of SHA-512 by default. Several recent distributions have moved to yescrypt ($y$), but $6$ is still common.
  • Ed25519 signatures. The signature scheme behind modern SSH keys uses SHA-512 internally.
  • Release checksums. Some projects publish .sha512 files instead of, or alongside, SHA-256.

SHA-512, SHA-384 and SHA-512/256

SHA-384 and SHA-512/256 are both SHA-512 run with different starting values and cut short to 384 or 256 bits. They keep SHA-512's 64-bit speed profile with a shorter output, and unlike plain SHA-512 or SHA-256 the truncated versions are not open to length-extension attacks. SHA-384 is available in the multi-hash generator; Web Crypto does not provide SHA-512/256.

Hex or Base64

A SHA-512 digest is 64 bytes. This page shows it as hex. npm, SRI attributes and many APIs show the same bytes as Base64, which is shorter: the hex hash of hello above becomes m3HSJL1i83hdltRq0+o9czGb... in Base64. If two values look nothing alike, check whether one is hex and the other Base64 before assuming the inputs differ.

Hashing Is Not Encryption

A SHA-512 hash cannot be turned back into its input. The $6$ format shows the right way to use a fast hash for passwords: add a unique salt so precomputed tables are useless, and repeat the hash thousands of times so each guess costs more. For reversible encoding use Base64, and to sign messages with a key use the HMAC-SHA512 generator. For most new projects SHA-256 is the more common choice.

Related Tools

Frequently Asked Questions

How long is a SHA-512 hash?
512 bits, written as 128 hex characters, or 88 characters in Base64. The SHA-512 of "hello" starts 9b71d224bd62f378 and ends 73bcdec043.
Is SHA-512 more secure than SHA-256?
In theory it has a bigger margin: 256-bit collision resistance against SHA-256's 128. In practice both are far beyond any known attack, so the choice comes down to output size, speed and what the protocol you are working with requires.
Is SHA-512 faster than SHA-256?
In plain software on a 64-bit CPU, often yes for long inputs, because it processes 128-byte blocks using 64-bit arithmetic. Many current x86 and ARM chips have dedicated SHA-256 instructions, though, and on those SHA-256 usually wins. Measure on your own hardware (openssl speed sha256 sha512) if it matters.
How do I check an npm integrity value?
package-lock.json stores integrity as "sha512-" followed by the Base64 of the tarball's SHA-512, not hex. For a downloaded tarball, run openssl dgst -sha512 -binary pkg.tgz | openssl base64 -A and compare.
Can a SHA-512 hash be decrypted?
No. It is a one-way function and the input is not stored in the hash. Sites that claim to decrypt SHA-512 compare it against hashes of word lists and leaked passwords, so they only find common inputs.