DEV Community

Dev Nestio
Dev Nestio

Posted on

Hash Generator – MD5, SHA-1, SHA-256, SHA-512 from Text or File (Free Browser Tool)

Hash Generator

Generate cryptographic hashes instantly in your browser: devnestio.pages.dev/hash-generator/

No server, no uploads — everything runs locally.

Supported Algorithms

Algorithm Output Security
MD5 128 bit (32 hex) Broken — checksums only
SHA-1 160 bit (40 hex) Deprecated — legacy only
SHA-256 256 bit (64 hex) Secure — general purpose
SHA-384 384 bit (96 hex) Secure — high security
SHA-512 512 bit (128 hex) Strongest available

Features

  • Text mode — type or paste and see all hashes instantly
  • File mode — drag-and-drop any file, hashed locally
  • Uppercase/lowercase toggle
  • Hash compare — paste an expected hash to verify a match
  • Copy buttons for each hash
  • Algorithm reference table with security ratings

Implementation

SHA hashes use the built-in Web Crypto API (no library needed):

async function sha(algo, bytes) {
  const buf = await crypto.subtle.digest(algo, bytes);
  return Array.from(new Uint8Array(buf))
    .map(v => v.toString(16).padStart(2, '0'))
    .join('');
}

async function computeHashes(bytes) {
  const [h1, h256, h384, h512] = await Promise.all([
    sha('SHA-1', bytes),
    sha('SHA-256', bytes),
    sha('SHA-384', bytes),
    sha('SHA-512', bytes),
  ]);
  // MD5 via pure JS implementation
  const md5hash = md5(new TextDecoder().decode(bytes));
  // display results...
}
Enter fullscreen mode Exit fullscreen mode

MD5 is implemented in pure JS (RFC 1321) since the Web Crypto API doesn't support it.

Hash Compare / Verify

Paste an expected hash into the compare field — the tool checks it against all five algorithms and shows a match/no-match badge:

function compareHash() {
  const input = document.getElementById('compareInput').value.trim().toLowerCase();
  const match = Object.values(currentHashes).some(h => h.toLowerCase() === input);
  // show match or no-match badge
}
Enter fullscreen mode Exit fullscreen mode

Try It

devnestio.pages.dev/hash-generator/


Part of the DevNestio developer tools collection.

Top comments (0)