Hash Text
Create a checksum from any text with SHA-1, SHA-256, SHA-384, or SHA-512. Runs locally — nothing leaves your browser.

Hashing happens with the Web Crypto API on your device — nothing is uploaded.

Password & Security

Hash Generator

Hash text with SHA-1, SHA-256, SHA-384, or SHA-512.

Hash Generator creates SHA-1, SHA-256, SHA-384, or SHA-512 digests from any text as you type. The default is SHA-256 with lowercase hex output; toggle Base64 output for an alternate encoding. A live counter shows input character count and expected digest length (40 / 64 / 96 / 128 hex characters).

Hashing runs entirely in the browser with the Web Crypto API — the card states Runs locally — nothing leaves your browser. Ideal for verifying checksums, matching known test vectors, or comparing digests without pasting secrets into an online form.

How it works

On each change the form debounces 120 ms, then crypto.subtle.digest(algorithm, TextEncoder.encode(text)) returns the raw bytes. Hex mode pads each byte to two lowercase hex digits; Base64 mode builds a binary string and btoa()s it.

Algorithms and bit sizes: SHA-1 (160), SHA-256 (256), SHA-384 (384), SHA-512 (512). Empty input clears the output. Known-answer tests pin published vectors for input abc.

How to use

  1. Open Hash Generator (card title Hash Text).
  2. Type or paste into Input text (placeholder: Type or paste text to hash…).
  3. Choose Algorithm — default SHA-256 (256 bits); options include SHA-1 (160 bits), SHA-384 (384 bits), SHA-512 (512 bits).
  4. Optionally tick Base64 output to switch encoding from hex.
  5. Wait ~120 ms — the digest appears live in the readonly Output field.
  6. Read the counter under Output: N characters → M hex characters (or base64 estimate).
  7. Click Copy (aria becomes Copied for 2 seconds) and keep editing as needed.
  8. Clear the input to empty the output before switching secrets.

Tips

  • Output is always lowercase hex — compare case-insensitively against uppercase reference sums.
  • Trailing newlines change the digest (exact UTF-8 bytes are hashed) — the classic mismatch cause.
  • Default SHA-256 for general use; SHA-1 only to reproduce legacy checksums (no in-UI warning exists).
  • crypto.subtle requires a secure context (HTTPS or localhost).
  • Base64 length shown is ceil(bits/6); actual btoa output includes = padding (e.g. 44 chars for SHA-256).

Hash Generator FAQ

Is my text sent to a server?

No. The card says nothing leaves your browser; hashing uses the Web Crypto API on your device.

Why is my hash different from another tool's?

Check trailing newlines/whitespace, the algorithm, and case — this tool emits lowercase hex only.

Which algorithm should I pick?

SHA-256 (256 bits) by default; SHA-1 only for legacy checksums; SHA-384/SHA-512 when you need 96/128-character hex digests.

What are the output lengths?

Hex is bits/4 characters (40, 64, 96, 128); the Base64 counter shows ceil(bits/6) estimates (27, 43, 64, 86).

Does it hash files or support MD5?

No — input is a single textarea, and only SHA-1, SHA-256, SHA-384, and SHA-512 are offered.

Credits

ShareTweet

Command Palette

Search for a command to run...