Ambimat GroupAmbimatAmbiSecureV2XeSIM & eUICCAmbiAutomationEngineering BlogAhmedabad · India · Est. 1982
Crypto & integrity

SHA Hash Generator

Compute SHA-1, SHA-256, SHA-384, and SHA-512 digests of text, hex bytes, or a local file using the browser’s crypto.subtle.digest. Each digest is shown as lowercase hex and standard Base64, with copy buttons.

Client-sideWeb Crypto APINo upload

How to use this tool

What it does

Computes SHA-1, SHA-256, SHA-384 and SHA-512 digests of input text or hex.

When to use it

Use it to reproduce a fingerprint, verify a hash a system reports, or hash a challenge during protocol work.

Worked example

Hash the string test with SHA-256 and compare the digest to an expected value.

Input

Digests

Type something, or choose a file, to hash.
All hashing runs locally in your browser via the Web Crypto API. Your text, hex, and any chosen file are never uploaded.

What this SHA hash generator does

A cryptographic hash function maps any amount of input to a fixed-length digest that is practically impossible to reverse and, for a strong algorithm, infeasible to collide. This page computes the digest of whatever you type, paste as hex, or load from a local file, and renders it in two encodings: lowercase hexadecimal (the form printed by sha256sum and most command-line tooling) and standard Base64 (the form used in Subresource Integrity attributes, JWT thumbprints, and many certificate fingerprints).

Everything is computed with the browser’s built-in crypto.subtle.digest. There is no hand-rolled hashing JavaScript here — the bytes you see are exactly what the platform’s vetted Web Crypto implementation returns, identical to what any other application on the machine would compute. Because crypto.subtle is asynchronous, the page awaits each digest before displaying it.

When to use it

Reach for this tool when you need to verify a download against a published checksum, confirm two files are byte-identical, derive an SRI integrity value for a script tag, sanity-check a fingerprint your code produced, or learn how the four SHA-2 lengths differ. It pairs naturally with the certificate fingerprint tool when you are matching a thumbprint, and with the Base64 tool when you need to convert a digest between encodings.

Input and output

Choose how your input is interpreted. Text (UTF-8) encodes the characters you type as UTF-8 bytes before hashing. Hex bytes treats the input as raw bytes — useful when you already have a key or message in hex; separators, 0x prefixes, and whitespace are ignored, but the digit count must be even. The file button hashes the exact bytes of a local file and shows its name and size; an empty input still produces the well-known digest of the empty string.

For each selected algorithm the result panel lists the digest length in bits, the lowercase hex form, and the standard Base64 form, each with its own copy control. Choose “All four digests” to compare lengths side by side, or pick a single algorithm to focus on one value.

Supported and unsupported algorithms

Web Crypto’s SubtleCrypto.digest defines only four digests, and those are the only four offered here:

SHA-256 / 384 / 512

The SHA-2 family. SHA-256 is the modern default; SHA-384 and SHA-512 give longer digests for higher security margins.

SHA-1 (legacy)

160-bit and broken for collision resistance (SHAttered, 2017). Provided only to verify legacy values — never design new security around it.

Not available

SHA-224, SHA-512/224, SHA-512/256 and the entire SHA-3 / Keccak / SHAKE family are not in Web Crypto. We omit them rather than ship unverified crypto.

Common mistakes

Related tools

Certificate fingerprint

Compute SHA-1/256 fingerprints of an X.509 certificate.

Open fingerprint tool →

Base64

Convert a digest between Base64 and raw bytes or hex.

Open Base64 →

More utilities

Parsers, decoders, and references for smart-card and FIDO engineers.

All resources →

Frequently asked questions

Which SHA algorithms does this tool support?

Exactly the four digests the browser’s Web Crypto API natively implements: SHA-1, SHA-256, SHA-384 and SHA-512. The tool runs crypto.subtle.digest for each, so the output is the same bytes the platform would produce in any other Web Crypto call. It does not implement any algorithm in hand-written JavaScript.

Why are SHA-224, SHA-512/256 and SHA-3 not offered?

The WebCrypto SubtleCrypto.digest method only defines SHA-1, SHA-256, SHA-384 and SHA-512. SHA-224, the truncated SHA-512/224 and SHA-512/256 variants, and the entire SHA-3 / Keccak / SHAKE family are not available in the browser. Rather than ship an unverified pure-JavaScript implementation that could produce wrong digests, we intentionally omit them.

Is it safe to keep using SHA-1?

No, not for anything that relies on collision resistance. SHA-1 has practical collision attacks (SHAttered, 2017) and is forbidden for new digital signatures and certificates. It is included here only so you can verify or compare against legacy systems. Use SHA-256 or stronger for any new design.

What is the difference between the hex and Base64 output?

Both encode the identical digest bytes. Lowercase hex is the conventional form for checksums and command-line tools such as sha256sum. Standard Base64 is denser and shows up in Subresource Integrity attributes, certificate fingerprints and JWT thumbprints. Decode either back to the same raw bytes.

Does my input or file leave the browser?

No. The text, hex and any file you choose are read locally and hashed in memory with Web Crypto. Nothing is uploaded, logged, or sent to a server, so the tool is safe for sensitive content.