Generate a Hash from Any Text or String - Instantly
Paste or type any text above and this hash generator spits out its MD5, SHA-1, SHA-256, SHA-384, and SHA-512 digests in one click. Useful for verifying file integrity, creating checksums, building Content Security Policy (CSP) hashes, or just checking that two pieces of text are identical without comparing them character by character.
Your data never leaves your browser. All hashing runs locally in JavaScript using the Web Crypto API - nothing is sent to any server.
How to Use This Hash Generator
- Type or paste your text into the input box above.
- Choose an algorithm from the dropdown (MD5, SHA-1, SHA-256, SHA-384, or SHA-512).
- Pick your output format: hex (the default) or base64 (needed for Subresource Integrity / SRI tags).
- The hash digest appears instantly - click Copy to grab it.
- To verify a checksum, paste a known hash into the "Compare" field and the tool highlights whether they match.
Worked Example
Input text: Hello, World!
| Algorithm | Hex digest |
|---|---|
| MD5 | 65a8e27d8879283831b664bd8b7f0ad4 |
| SHA-1 | 0a0a9f2a6772942557ab5355d76af442f8f65e01 |
| SHA-256 | dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986d |
Change even one character - say Hello, World! to hello, World! - and every single digest changes completely. That's the avalanche effect: a tiny input change scrambles the whole output.
Algorithm Comparison: Which Hash Should You Use?
| Algorithm | Digest size | Hex chars | Cryptographically secure? | Best for |
|---|---|---|---|---|
| MD5 | 128-bit | 32 | ✘ Broken | Non-security checksums only |
| SHA-1 | 160-bit | 40 | ✘ Broken | Legacy systems, Git object IDs |
| SHA-256 | 256-bit | 64 | ✔ Yes | Signatures, TLS, SRI, general security |
| SHA-384 | 384-bit | 96 | ✔ Yes | Higher-assurance security needs |
| SHA-512 | 512-bit | 128 | ✔ Yes | Maximum digest length, archive integrity |
Quick rule: reach for SHA-256 by default. Use MD5 or SHA-1 only when an existing system requires it - not for passwords, tokens, or anything security-sensitive.
Important: Hashes Are One-Way - They Cannot Be 'Decrypted'
A hash function converts input into a fixed-length digest. That process is irreversible by design - you cannot run a hash backwards to recover the original text. What people call "MD5 decryptors" online are actually lookup tables: they check whether your hash appears in a database of pre-computed hashes for common inputs. Long, random, or unique strings will not appear in any table.
This one-way property is exactly what makes hashes useful for integrity checks: two files with the same SHA-256 digest are, for all practical purposes, identical.
MD5 and SHA-1 Are Cryptographically Broken - Here's What That Means
Researchers have demonstrated collision attacks against both MD5 and SHA-1 - meaning it is possible (with enough computing power) to craft two different inputs that produce the same hash. That breaks any use case that relies on uniqueness for security. For file checksums where you just want to confirm a download wasn't corrupted, MD5 is still fine. For digital signatures, password storage, or anything adversarial, use SHA-256 or higher. NIST formally deprecated SHA-1 for most uses in 2011.
How to Generate Hashes in Code
Python
import hashlib
text = 'Hello, World!'
print(hashlib.md5(text.encode()).hexdigest()) # MD5
print(hashlib.sha1(text.encode()).hexdigest()) # SHA-1
print(hashlib.sha256(text.encode()).hexdigest()) # SHA-256
All three algorithms are part of Python's built-in hashlib module - no install needed.
JavaScript (Node.js)
const crypto = require('crypto');
const text = 'Hello, World!';
console.log(crypto.createHash('md5').update(text).digest('hex')); // MD5
console.log(crypto.createHash('sha1').update(text).digest('hex')); // SHA-1
console.log(crypto.createHash('sha256').update(text).digest('hex')); // SHA-256
In a browser context, use the Web Crypto SubtleCrypto.digest() API instead (MD5 is not available there - another reason to prefer SHA-256).
Generating SRI Hashes (base64 output)
Subresource Integrity (SRI) is a browser security feature that lets you lock a <script> or <link> tag to a specific file version. The hash must be base64-encoded SHA-256 (or higher). Switch this tool's output to base64, choose SHA-256, paste your script content, and prepend sha256- to get a ready-to-use integrity attribute value.
When to Use a Hash Generator - and When Not To
- Use it for: verifying download integrity, building SRI tags, comparing strings without exposing their content, generating cache-busting keys, and creating unique identifiers from deterministic input.
- Do not use it for: storing passwords (use a slow, salted algorithm like bcrypt, Argon2, or scrypt instead), encrypting data (hashing is not encryption - there is no key and no way to reverse it), or any use case where you need to recover the original value.
Need to work with a single algorithm? Our focused MD5 Hash Generator and SHA-256 Hash Generator are great if you only need one digest at a time.
The NIST hash function standards page is the authoritative reference for which algorithms are recommended and which have been deprecated.
Every hash you need, right in your browser - paste your text above and grab the digest in seconds.