Skip to content
LocalOnly

Hash Generator

Stable

Compute SHA-1, SHA-256, SHA-384, and SHA-512 hashes of text or files.

Everything is processed locally in your browser

About Hash Generator

Compute cryptographic hashes of text or files using the browser's native Web Crypto API. Generate SHA-1, SHA-256, SHA-384, and SHA-512 digests side by side as lowercase hex, and verify a file's integrity by comparing its checksum. Hashing runs locally, so even large files never leave your machine.

Features

  • SHA-1, SHA-256, SHA-384, and SHA-512 computed with the Web Crypto API
  • Hash typed text or drag-and-drop files of any size
  • Lowercase hex output for every algorithm at once for easy comparison
  • Checksum verification - paste an expected hash to confirm a match
  • UTF-8 encoding of text input for consistent, reproducible digests
  • Streaming file reads so large files hash without freezing the page

How to use Hash Generator

  1. 1

    Provide the input

    Type or paste text, or drop in a file. Text is encoded as UTF-8 before hashing so results are reproducible across tools.

  2. 2

    Read the digests

    SHA-1, SHA-256, SHA-384, and SHA-512 hashes appear together as lowercase hex. Copy whichever one you need.

  3. 3

    Verify a checksum (optional)

    Paste an expected hash to compare it against the computed value - the tool tells you whether they match.

Examples

SHA-256 of a short string

The lowercase hex digest of the text 'hello'.

Input

hello

Output

2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

How cryptographic hash functions work

What a hash function guarantees

A cryptographic hash maps input of any length to a fixed-length digest. The same input always produces the same digest, and any change to the input - one bit - produces a completely different one. That is the avalanche property, and it is what makes hashes useful for detecting change.

Three properties matter. Preimage resistance means you cannot work backwards from a digest to an input. Second preimage resistance means given one input you cannot find a different input with the same digest. Collision resistance means you cannot find any two inputs that collide. When a hash is described as broken, it usually means collision resistance has fallen while preimage resistance still holds.

Hashing is not encryption and has no inverse. There is no key and no way to decrypt a digest, because the output is shorter than the input and the information is genuinely gone. When a site claims to reverse an MD5 hash, it is looking the digest up in a precomputed table of common inputs, not inverting the function.

Which algorithm to use

SHA-256 is the right default for anything security-relevant. It is standardised, widely implemented, hardware-accelerated on modern CPUs, and has no known practical weaknesses. SHA-512 is often slightly faster on 64-bit hardware and gives a longer digest, which matters mainly for long-term security margins.

MD5 and SHA-1 are both broken for collision resistance, and not theoretically - practically. A chosen-prefix collision for SHA-1 was demonstrated in 2020 for roughly the cost of a modest cloud compute bill, and MD5 collisions are trivial. Neither should be used for signatures, certificates or anything where an attacker could benefit from producing two files with the same digest.

They remain acceptable for non-adversarial integrity checks - verifying a file downloaded correctly, or as a fast key in a hash table - because an accidental collision remains vanishingly unlikely. The distinction is whether anyone has an incentive to construct a collision deliberately. Many systems still publish MD5 checksums for exactly this reason, and it is defensible as long as nobody mistakes it for a security guarantee.

Never use these for passwords

This is the most consequential misuse of hash functions and it is worth stating plainly. SHA-256 is designed to be fast, and that speed is exactly what makes it unsuitable for passwords. A modern GPU computes billions of SHA-256 hashes per second, so a leaked database of SHA-256 password hashes can be attacked at enormous rates. Most user passwords fall in hours.

Password hashing needs a deliberately slow, memory-hard function with a per-user salt. Argon2id is the current recommendation, with bcrypt and scrypt both still acceptable and PBKDF2 adequate where a certified primitive is required. These are tunable: you set a cost parameter so that verifying one password takes a noticeable fraction of a second, which is imperceptible to a user logging in and catastrophic for an attacker trying billions of guesses.

The salt matters independently. A unique random salt per password means identical passwords produce different hashes, which defeats rainbow tables and stops an attacker learning that two users share a password. Argon2 and bcrypt handle salting for you, which is another reason to use them rather than assembling something from a general-purpose hash.

When you need authentication, not just a digest

A plain hash proves nothing about origin. Anyone can compute the digest of a message, so a digest alone does not show that the message came from someone holding a secret. If you are verifying a webhook signature or an API request, you need HMAC.

HMAC combines a hash with a secret key in a specific nested construction. Only someone with the key can produce a valid HMAC, so it authenticates as well as detects change. Stripe, GitHub and most webhook providers sign payloads with HMAC-SHA256 for this reason.

The important implementation detail is that HMAC comparison must be constant-time. A normal string comparison returns as soon as it finds a differing byte, and the timing difference leaks how many leading bytes were correct - which is enough to recover a signature byte by byte. Use your platform's `timingSafeEqual` or equivalent rather than `==`.

Reference

Hash algorithms

AlgorithmDigestStatusUse for
MD5128 bit / 32 hexBrokenNon-adversarial checksums only
SHA-1160 bit / 40 hexBrokenLegacy compatibility only
SHA-256256 bit / 64 hexSecureThe general-purpose default
SHA-384384 bit / 96 hexSecureLonger margin where required
SHA-512512 bit / 128 hexSecureOften faster on 64-bit hardware
Argon2idConfigurableSecurePasswords - not available here
bcrypt184 bitSecurePasswords - not available here

Which tool should you use?

These tasks overlap. Here is how to pick the right one for what you are actually doing.

You are verifying that a file downloaded intact
SHA-256. Compare against the digest the publisher provides.
You are storing user passwords
Do not use any algorithm here. Use Argon2id or bcrypt in your backend - general-purpose hashes are far too fast to be safe for passwords.
You are verifying a webhook signature
You need HMAC with the shared secret, plus a constant-time comparison. A plain digest does not authenticate.
You need a unique identifier
The UUID Generator is the right tool. A hash of your data is deterministic, which is usually not what an identifier should be.
You need to recover the original data later
Hashing is one-way. Use Base64 for reversible encoding, or real encryption for confidentiality.

Use cases

  • Verifying that a downloaded file matches its published checksum
  • Generating content-addressable keys and cache identifiers
  • Creating deterministic fingerprints for deduplication
  • Producing digests for HMAC and webhook signature debugging
  • Comparing two files or strings for byte-for-byte equality

Troubleshooting common errors

Your digest does not match the published one

Why: Almost always a difference in the input bytes rather than in the algorithm - a trailing newline, CRLF versus LF line endings, or a byte order mark.

Fix: Hash the raw file rather than pasted text. Copying through an editor frequently normalises line endings.

The same text gives different digests in two tools

Why: A text-encoding difference. UTF-8 and UTF-16 produce entirely different byte sequences for the same characters.

Fix: Confirm both are hashing UTF-8 bytes. Also check for invisible trailing whitespace.

A security audit flagged your SHA-256 password hashes

Why: SHA-256 is far too fast for password storage, regardless of salting.

Fix: Migrate to Argon2id or bcrypt, rehashing on next successful login. This is a genuine and commonly-found vulnerability.

You need the original data back from a hash

Why: Hashing is one-way by design; the information is not present in the digest.

Fix: There is no way to reverse it. If you need recoverable data, you needed encryption rather than hashing.

Signature comparison seems to work but was flagged as insecure

Why: A byte-by-byte comparison that short-circuits leaks timing information.

Fix: Use a constant-time comparison function. This is a real, exploitable class of vulnerability.

Limitations

What this tool deliberately does not do, so you know when to reach for something else.

  • Hashing is one-way; a digest cannot be reversed.
  • MD5 and SHA-1 are included for compatibility but are broken for collision resistance.
  • No password-hashing algorithm is offered, because those belong server-side with a tuned cost parameter.
  • HMAC is not computed here, since that would mean handling your secret key.
  • Very large files are limited by browser memory, as the whole input is hashed at once.

Frequently asked questions

Learn more

Command Palette

Search for a tool or command