Generate an Argon2 Hash — Free Argon2id/i/d Generator

Enter a password, tune the iterations, memory, and parallelism settings, and the Argon2 Hash Generator returns both the encoded hash and the raw hash (hex) using Argon2id, Argon2i, or Argon2d — the algorithm that won the 2015 Password Hashing Competition and is now the recommended default for new applications. You can set your own salt or let it generate one for you, and everything runs entirely in your browser via WebAssembly, verified byte-for-byte against an independent reference implementation before it shipped.

Powered by argon2-browser (WebAssembly) -- verified byte-for-byte against the independent argon2-cffi reference implementation for all 3 variants before shipping. Higher settings take longer and may take several seconds in-browser.

Every time a user creates an account on your platform, their password becomes a liability unless it is protected by a robust, modern password hashing algorithm. This argon2 hash generator gives you cryptographic argon2 hash output — including the encoded variant, version tag, parameters, salt, and output bytes — all computed entirely in your browser. Understanding the output empowers you to configure production-grade login flows, debug framework integrations, and make informed decisions about tuning parameters that balance protection against login latency on your processing server.

Argon2 Password Hash Generator — Parameters, Output Format, and Encoded Hash Anatomy

Generate Hash with Argon2id, Argon2i, or Argon2d

The generator presents a plaintext input field alongside a variant selector offering argon2id, argon2i, and argon2d. Below the variant selector sit the four cost controls that directly govern the algorithm's work factor. Once you click Generate, the tool runs the full Argon2 algorithm using the WebAssembly reference implementation — nothing leaves your browser. This browser-based approach means no plain text password is stored anywhere; it is a genuinely client-side, runs locally computation.

The five input parameters the tool exposes mirror the RFC 9106 specification exactly:

Memory cost (m)
The memory usage in kibibytes the algorithm allocates per hash operation. Raising memory cost (m) directly increases the cost of GPU parallelisation and ASIC attacks. The current baseline is m=19456 (19 MiB); a stronger setting is m=65536 (64 MiB). As hardware advances, plan to increase this value — the OWASP cheat sheet recommends revisiting tuning parameters at least yearly.
Time cost / iterations (t)
The number of passes the algorithm makes over the allocated memory — the number of iterations, or hash passes, performed. Higher values extend execution time linearly and raise the iterations parameter independently of memory. The OWASP minimum is t=2; the Authelia recommended profile default is t=3. If your processing latency budget is generous, increase time cost before touching memory.
Parallelism (p)
The number of parallel threads — parallelism lanes — the algorithm spawns. Set this equal to the number of CPU cores available on your processing server. Single-threaded mode is the OWASP minimum setup; the Authelia default is p=4. Parallelism does not meaningfully raise attacker cost on its own, but allows the hash to consume multiple cores at verification time.
Salt
A cryptographically secure random value, auto-generated per hash. A minimum salt length of 16 bytes (128-bit) is the accepted guideline. The password salt is auto-generated and the generator defaults to -s 16 (salt size bytes) in line with the Authelia CLI. Never supply a fixed or reused salt — doing so defeats rainbow table resistance entirely.
Output length
The length of the resulting hash output in bytes. Standard output is 32 bytes (256 bits), matching the Authelia default key size. Increase to 64 bytes for higher-assurance applications such as drive-level protected key derivation.

Verify and Output — Reading the Encoded Hash String

After generation, the tool displays the fully encoded hash in the standard PHC string format. The encoded hash format embeds every parameter needed for verification, making the string self-contained for secure credential storage:

$argon2id$v=19$m=65536,t=3,p=4$[base64 salt]$[base64 hash]

Each dollar-sign-delimited segment carries a specific meaning:

  • $argon2id$ — variant prefix identifying the argon2id variant (or $argon2i$ / $argon2d$ for the other two modes)
  • v=19 — the version indicator, always v=19 for Argon2 version 1.3
  • m=65536,t=3,p=4 — the tuning parameters embedded in the hash string format for reproducibility
  • [base64 salt] — the Base64-encoded random salt (base64 salt), typically 22 characters for a 16-byte salt
  • [base64 hash] — the Base64-encoded output (base64 encoding of the raw output bytes)

The verify tab accepts a saved hash and a plaintext password. The tool decodes the parameter embedding from the encoded output string, re-derives the hash using the recovered salt and parameters, and compares the result in constant time. A pass/fail result confirms whether the plain-text password matches the saved login record. This plain text verification workflow is identical to what your server-side framework performs at login time.

Client-side safety note: Although all computation is browser-based and no passwords are stored server-side, we still recommend using a demo password or test fixture rather than a real production secret when using any online tool. The principle of minimising exposure of live secrets is a foundation of data protection and infosec hygiene.

Argon2 Hash Validator — Verifying an Existing Hash Against a Plaintext

How Hash Verification Works

The argon2 hash validator (also called a hash verifier or password verifier) accepts two inputs: the encoded hash string copied from your database and the candidate plaintext. It extracts the variant, version, and all tuning parameters directly from the encoded string via parameter embedding, then regenerates the output using the embedded base64 salt. If the regenerated output matches the saved output, verification succeeds. Because the algorithm is a one-way operation — computationally infeasible to invert — verification always works forward, never backward.

Common reasons hash verification fails in framework contexts include:

  • Variant prefix mismatch — your verifier expects $argon2id$ but the saved hash begins with $argon2i$ or $argon2d$. Always confirm your library's default variant matches what was used during hash generation.
  • Encoding mismatch — some libraries store hex encoding rather than base64 encoding, or strip trailing padding characters. Confirm your database stores the complete encoded string, not just the raw hash bytes.
  • Whitespace / line endings — copy-paste artifacts can append invisible characters that invalidate the hash string format.
  • Parameter mismatch — if your application overrides memory or iteration parameters at verify-time instead of reading them from the saved record, the comparison will fail.
Annotated encoded hash string — each segment explained
$argon2id $ v=19 $ m=19456,t=2,p=1 $ c29tZXJhbmRvbXNhbHQ $ aGFzaG91dHB1dGJhc2U2NA

Argon2 Hash Generator & Verifier — Why Argon2 Won the Password Hashing Competition

What Is Password Hashing and Why Plaintext Storage Is Dangerous?

Password hashing is a one-way process that converts a plain-text password into a bit string of a fixed size — a digest — using a cryptographic hash function. A cryptographic hash function is designed to be a one-way operation: infeasible to invert. Storing hashed login data rather than plaintext means that a database breach exposes only the hashed output, not the login details themselves. An attacker who steals hashed output must then perform cracking attacks — processing candidate entries one by one and comparing them to the saved value — rather than simply reading the plaintext. Modern resistant functions make this economically prohibitive at scale. Outdated methods such as md5, sha1, and plain sha256 are not resistant to GPU attacks and can be attacked with parallelisation at billions of guesses per second.

What Is a Key Derivation Function (KDF)?

A key derivation function (KDF) is a specialised cryptographic procedure designed to derive a cryptographic key — or a securely stored login record — from a low-entropy input like a passphrase. Unlike general-purpose digest functions such as SHA-256 or SHA-512, a KDF is intentionally slow and resource-intensive. It accepts input parameters (memory, time, parallelism) that let you tune how expensive each computation is. Argon2 is a KDF; so are bcrypt, scrypt, and PBKDF2. Plain sha-256 or sha-512 without iteration is not a KDF and must never be used for protecting login data. The KDF design pattern also supports key stretching for drive protection, API key hardening, and cryptocurrency key derivation — anywhere a low-entropy passphrase must produce a high-entropy cryptographic key.

The Password Hashing Competition and Argon2's PHC 2015 Victory

The Password Hashing Competition (PHC) was an open competition organised by cryptography and cybersecurity experts to identify a preferred approach for strong password protection. The PHC ran from 2013 to 2015 and attracted 24 candidate algorithms. Argon2 was selected as the final PHC winner on 20 July 2015 — the argon2 winner designation that makes it the de-facto preferred algorithm for modern application development. Argon2 was designed by Alex Biryukov, Daniel Dinu, and Dmitry Khovratovich from the University of Luxembourg. Its design is captured in the argon2 specifications PDF and implemented in the open argon2 source code reference implementation.

Argon2 Variants — Argon2d, Argon2i, and Argon2id Compared

The three argon2 variants differ in how they traverse memory and in what threat model they optimise for. Variant selection has real consequences for identity protection and access control:

Argon2d (argon2d variant)
Uses data-dependent memory access — each memory block's address depends on the content of previous blocks. This maximises resistance to GPU attacks and ASIC attacks at the cost of vulnerability to cache-timing attacks. Best suited for cryptocurrency key derivation and drive-level protection, not interactive login hashing.
Argon2i (argon2i variant)
Uses data-independent memory access, making it resistant to side-channel attacks and suitable for smart cards and HSMs. Slightly weaker against GPU attacks because the memory access pattern is predictable. Recommended for environments where the attacker can observe cache timing. The data-independent mode is less recommended than Argon2id for general-purpose login protection on modern web applications.
Argon2id
The hybrid argon2id variant: the first half of the memory pass uses data-independent memory access (like Argon2i), and the second half uses data-dependent access (like Argon2d). This combination provides resistance to both side-channel attacks and GPU/ASIC brute-force attacks. OWASP, NIST, and RFC 9106 all identify Argon2id as the recommended default for identity verification, access control enforcement, and secure key derivation in modern deployments.

Why Argon2id Is the Default for Password Security

The resistant design of Argon2id means that every candidate an attacker tests must allocate a large block of memory — by default 64 MiB — making GPU parallelisation expensive even on modern hardware. Functions with high memory requirements impose a burden that grows with the number of parallel cracking attempts, so GPU farms and custom ASICs cannot amortise the cost across thousands of simultaneous guesses the way they can with sha-256. Combined with a unique cryptographic salt per hash, password salting ensures that precomputed rainbow table attacks and dictionary attacks against multiple accounts simultaneously are defeated. The salt generation is automatic, cryptographically secure, and embedded in the encoded string — you never need to manage it separately. Adding a pepper (a site-wide server secret stored outside the database) via pepper management further hardens login data against a database-only breach, though pepper requires careful secret management like other sensitive settings.

Generate Argon2 Hashes — Step-by-Step Usage, CLI Reference, and Security Best Practices

Tool Usage — Generating and Copying Your Hash

This online argon2id hash generator tool is designed to make debugging integrations straightforward for server-side developers building web applications and APIs. The workflow is linear:

  1. Enter your password in the plaintext field. Use a demo password or test fixture — avoid real login data or live secrets in any online tool.
  2. Select the variantArgon2id for the vast majority of use cases. Data-independent mode if your deployment targets smart cards or HSMs; data-dependent mode only for cryptocurrency key derivation or drive-level protection contexts.
  3. Set tuning parameters — start with the sensible defaults below and benchmark on your actual servers before finalising.
  4. Click Generate — the encoded hash string appears immediately.
  5. Copy the complete encoded string (including the $argon2id$ prefix) to your database or settings files. Never store only the raw bytes.
  6. Switch to the verify tab — paste the saved hash and plaintext to confirm hash verification before deploying.

Cost Parameters Explained — Production Defaults and Tuning

Recommended defaults align with the OWASP 2026 baseline and the Authelia recommended profile. The following values represent sensible starting points; always benchmark on your own servers and tune for your latency targets:

  • Memory cost (m): m=65536 (64 MiB) — the Authelia default and a strong general-purpose setting. The OWASP 2026 minimum is m=19456 (19 MiB). As hardware advances, increase memory first.
  • Time cost / iterations (t): t=3 — three passes over memory. OWASP minimum is two passes. Increase the iterations parameter for higher protection if processing latency allows.
  • Parallelism (p): p=4 — set equal to available CPU cores. OWASP minimum is a single thread. Parallelism threads should reflect your server's core count.
  • Salt size: 16 bytes minimum (128-bit); the Authelia CLI default is -s 16. Use a larger salt size for higher-protection environments.
  • Output length / key size: 32 bytes (256 bits) is standard. Authelia defaults to -k 32 (key size bytes).

Target hash latency of 300–500 ms for interactive logins on modest hardware. On actual servers under real load, benchmark your settings to confirm you hit your processing latency and login targets without degrading the user experience. A hash that takes 300–500 ms to compute is ideal for interactive login flows; longer is acceptable for high-value or low-frequency login paths.

Security Best Practices for Password Storage

Strong password hashing with correct tuning is only one layer of login protection. Observe these security best practices throughout your login flow:

  • Never log plaintext passwords or plain-text password values at any log level.
  • Always use a unique salt — unique salt, auto-generated per login record. Reusing salts across users enables precomputed rainbow table attacks.
  • Store only the complete encoded hash — the full encoded string storage approach is essential so the verifier can extract parameters automatically.
  • Use secure randomness for salt generation — never derive salts from user data or timestamps.
  • Consider adding a pepper (server secret) as a second factor, managed through a secrets manager alongside other live secrets. This provides protection even if the database is fully compromised.
  • Plan to increase tuning parameters as hardware advances — schedule a yearly review of your settings.
  • Stop using outdated methods — md5, sha1, and plain sha256 are not suitable for protecting login data. These produce a fixed-size output in microseconds, making cracking trivial at scale.

CLI Reference — authelia crypto hash generate argon2

For server-side crypto hash generate argon2 operations via the command line (CLI / command line interface), the Authelia subcommand exposes the full parameter set. Use this argon2id hash and verify tool subcommand to produce cryptographic argon2 output in settings pipelines, making it a practical argon2 hash generator & verifier for DevOps workflows:

authelia crypto hash generate argon2 --help

Usage:
  authelia crypto hash generate argon2 [flags]

Flags:
  -h, --help                    help for argon2
  -i, --iterations int          number of iterations (default 3)
  -k, --key-size int            key size in bytes (default 32)
  -m, --memory int              memory in kibibytes (default 65536)
  -p, --parallelism int         parallelism or threads (default 4)
      --profile string          profile to use: low-memory or recommended
  -s, --salt-size int           salt size in bytes (default 16)
  -v, --variant string          argon2id, argon2i, or argon2d (default "argon2id")

Global Flags:
  -c, --config strings          configuration files or directories to load
      --no-confirm              skip the password confirmation prompt
      --password string         supply password via terminal prompt
      --random                  use a randomly generated password
      --random.charset string   ascii, alphanumeric, alphabetic, numeric, numeric-hex, rfc3986
      --random.length int       character length for the random string (default 72)

The --profile flag accepts low-memory or recommended — the recommended profile matches the defaults above. Use --random with --random.charset alphanumeric to generate a randomly generated password for testing without a prompt. The --random.characters flag accepts explicit characters if you need a custom alphanumeric charset, ASCII charset, alphabetic charset, or numeric charset. The tool also supports numeric-hex and rfc3986 charset options.

Argon2 Implementation Examples by Language — PHP, Node.js, Python, and Java

Every major language ecosystem provides a well-maintained, trusted argon2id library. The following examples demonstrate the minimum viable pattern for secure login hashing and hash verification. Always use these trusted libraries rather than rolling your own implementation.

PHP — password_hash and password_verify (Argon2id)

Argon2 PHP support is built into PHP 7.3+ via the password_hash and password_verify functions. No additional dependency is required:

PHP — Install Dependency
<?php
// Built into PHP 7.3+ — no composer dependency required
// Confirm Argon2 support: php -r "echo defined('PASSWORD_ARGON2ID') ? 'ok' : 'missing';"
PHP — Example Usage (Argon2id)
<?php
$password = 'CorrectHorseBatteryStaple';

// Hash using PASSWORD_ARGON2ID constant
$hash = password_hash($password, PASSWORD_ARGON2ID, [
    'memory_cost' => 65536, // 64 MB in KB
    'time_cost'   => 3,
    'threads'     => 4,
]);

echo $hash;
// $argon2id$v=19$m=65536,t=3,p=4$...$...

// Verify — password_verify extracts parameters from the saved hash automatically
if (password_verify($password, $hash)) {
    echo 'Password valid — login successful.';
} else {
    echo 'Invalid password.';
}

Node.js — argon2 npm Package with Async/Await

Argon2 Node.js support is provided by the argon2 npm package — a native binding to the reference C implementation. This is the canonical JavaScript server-side argon2 library.

Node.js — Install Dependency
npm install argon2
Node.js — Example Usage (Argon2id type, async pattern)
const argon2 = require('argon2');

async function hashPassword(password) {
  return argon2.hash(password, {
    type: argon2.argon2id,      // argon2id type
    memoryCost: 65536,          // memoryCost in KB (64 MiB)
    timeCost: 3,                // timeCost (iterations)
    parallelism: 4,             // parallelism threads
    hashLength: 32,             // hashLength in bytes
    saltLength: 16,             // saltLength in bytes
  });
}

async function verifyPassword(storedHash, password) {
  const isValid = await argon2.verify(storedHash, password);
  return isValid;
}

(async () => {
  const password = 'CorrectHorseBatteryStaple';

  const hash = await hashPassword(password);
  console.log('Encoded hash:', hash);
  // $argon2id$v=19$m=65536,t=3,p=4$...$...

  const valid = await verifyPassword(hash, password);
  console.log('Password valid?', valid); // true
})();

Python — argon2-cffi Python Binding

Argon2-cffi is the standard Python binding to the Argon2 reference implementation. It wraps the C library via CFFI and exposes a high-level PasswordHasher API. Install via:

Python — Install Dependency
pip install argon2-cffi
Python — Example Usage
from argon2 import PasswordHasher
from argon2.exceptions import VerifyMismatchError

# Instantiate with production-grade parameters
ph = PasswordHasher(
    time_cost=3,       # iterations
    memory_cost=65536, # 64 MiB in KB
    parallelism=4,
    hash_len=32,       # output length in bytes
    salt_len=16,       # 16-byte random salt
)

password = 'CorrectHorseBatteryStaple'

# Hash — salt is auto-generated
hash = ph.hash(password)
print(hash)
# $argon2id$v=19$m=65536,t=3,p=4$...$...

# Verify — raises VerifyMismatchError on failure
try:
    ph.verify(hash, password)
    print('Password valid.')
except VerifyMismatchError:
    print('Invalid password.')

Java — de.mkammerer.argon2 Java Binding

Argon2 Java support is available through the de.mkammerer.argon2 Maven dependency — a JVM binding to the native Argon2 library.

Java — Install Dependency (Maven)
<dependency>
  <groupId>de.mkammerer</groupId>
  <artifactId>argon2-jvm</artifactId>
  <version>2.11</version>
</dependency>
Java — Example Usage
import de.mkammerer.argon2.Argon2;
import de.mkammerer.argon2.Argon2Factory;

public class Argon2Example {
    public static void main(String[] args) {
        Argon2 argon2 = Argon2Factory.create(Argon2Factory.Argon2Types.ARGON2id);

        char[] password = "CorrectHorseBatteryStaple".toCharArray();

        // Hash: iterations=3, memory=65536 KB, parallelism=4
        String hash = argon2.hash(3, 65536, 4, password);
        System.out.println(hash);

        // Verify
        if (argon2.verify(hash, password)) {
            System.out.println("Password valid.");
        } else {
            System.out.println("Invalid password.");
        }

        // Wipe password from memory
        argon2.wipeArray(password);
    }
}

Argon2id vs bcrypt vs scrypt vs PBKDF2 — Choosing the Right Password Hashing Algorithm

Algorithm Comparison — Memory-Hardness, GPU Resistance, and Compliance

Selecting a password hashing algorithm is one of the most consequential decisions in application development. The table below summarises the key protection properties across the algorithms you are likely to encounter. Use it alongside the prose guidance that follows to make an informed choice for your threat model:

AlgorithmUse for Passwords?Memory-Hard?GPU-Resistant?Purpose / Notes
Argon2id✅ Yes — recommended✅ Yes (configurable)✅ YesPHC winner (2015). Best overall for new deployments. OWASP and NIST recommended. RFC 9106.
bcrypt✅ Yes — acceptable fallback⚠️ Partially (fixed 4 KB RAM)⚠️ PartiallyBattle-tested and widely available. Fixed memory footprint (4 KB) limits resistance as hardware advances. 72-byte input limit. Cost 12–14 for 2026 minimum.
scrypt✅ Yes — acceptable✅ Yes✅ YesRAM-intensive, well-studied. Parameters tightly coupled (N, r, p). Less tooling than Argon2. 2026 baseline: N=2^17, r=8, p=1 (128 MiB).
PBKDF2 (PBKDF2-HMAC-SHA256 / PBKDF2-HMAC-SHA512)⚠️ Only if FIPS required❌ No❌ NoNot resistant to GPU parallelisation. NIST SP 800-63B (2024 update): 600,000 iterations for PBKDF2-HMAC-SHA256; 210,000 for PBKDF2-HMAC-SHA512. FIPS mandated where Argon2 is unavailable.
HMAC-SHA256 / HMAC-SHA512 (message authentication)❌ No❌ No❌ NoMessage authentication and data integrity only. Not a key derivation function or password protection method. Never use for login record storage.
MD5 / SHA-1 / SHA-256 alone❌ Never❌ No❌ NoGeneral-purpose digest functions — not KDFs. Computationally trivial to attack. Deprecated for login record storage by OWASP guidance and protective analysis.

Recommendation summary: Choose Argon2id for all new deployments — it is the preferred approach backed by OWASP, NIST, and RFC 9106. Use bcrypt (cost ≥ 12) as a compatibility fallback for existing deployments where Argon2 is unavailable — the $2b$ format offers broad compatibility. Use scrypt if your runtime has a well-maintained scrypt library but lacks a maintained argon2id library. Use PBKDF2 only when regulatory adherence or NIST SP 800-132 password-based key derivation requirements mandate it, or when Argon2 and bcrypt are both unavailable. Never use MD5, SHA-1, or plain SHA-256 for protecting login data under any circumstances — these are inadequate digest methods regardless of iteration count.

Migrating from bcrypt to Argon2id Without Forcing a Password Reset

Migrating from bcrypt to Argon2id is straightforward and requires no forced credential resets. The technique is called opportunistic rehashing — progressively upgrading saved login records on each successful sign-in:

  1. Store a per-user hash version field in your user table indicating which algorithm protects the login record.
  2. On each successful sign-in, read the saved record and verify it using the algorithm indicated by the version field.
  3. After a successful sign-in, hash the plain-text password they just typed using Argon2id with your recommended defaults, update the saved record, and set the version field to argon2id. This is credential migration via the login path.
  4. Continue verifying inactive users with bcrypt until they next sign in. You can prompt remaining inactive users through a credential reset after a defined window.
  5. Once all users have migrated, remove the bcrypt verification branch from your login flow.

This approach requires no downtime, no forced credential reset, and no user communication. Within a few weeks of normal user activity the majority of accounts complete the algorithm transition automatically. The prefix difference between bcrypt's $2a$ vs $2b$ and Argon2id's $argon2id$ makes it trivial to detect which algorithm to use for verification from the saved hash string. Track login protection improvements through your version field and developer tools dashboards.

Data protection note: Always verify that your ORM or database layer stores the full encoded hash string, not a truncated form. Framework verification issues during migration are almost always caused by an encoding mismatch, whitespace line endings introduced by copy-paste, or a bcrypt prefix difference ($2a$ vs $2b$) mishandled by the framework. Use the argon2 hash generator & verifier above to confirm the encoded hash pair round-trips correctly before deploying updated login logic to production. Application integrity depends on getting these details right, and this tool is designed to make that validation straightforward for server-side developers.

Frequently Asked Questions

Which Argon2 variant should I use?
Argon2id (this tool's default) is the recommended choice for almost all password-hashing use cases -- it's a hybrid that combines Argon2i's resistance to side-channel attacks with Argon2d's resistance to GPU cracking. Argon2i alone is for scenarios needing maximum side-channel resistance (like disk encryption); Argon2d alone is for scenarios with no side-channel risk (like cryptocurrency mining) wanting maximum GPU resistance.
What do the time, memory, and parallelism parameters control?
Time (iterations) controls how many passes the algorithm makes over memory. Memory (in KiB) controls how much RAM each hash computation requires -- this is Argon2's primary defense, since large memory requirements are expensive to parallelize on GPUs/ASICs. Parallelism controls how many independent lanes process that memory simultaneously, useful for tuning around available CPU cores.
How was this implementation verified?
The underlying library, argon2-browser, compiles the official reference Argon2 C implementation to WebAssembly rather than reimplementing the algorithm in JavaScript. Before shipping this tool, its output was independently verified byte-for-byte against argon2-cffi (a separate, widely used Python binding to the same reference C library) for all three variants (Argon2id/i/d) with identical inputs.
Why does hashing take a few seconds sometimes?
That's the intended behavior -- Argon2's whole design goal is to make each hash computation expensive in both time and memory, so brute-forcing many guesses becomes proportionally expensive too. Higher memory/time settings are more secure but slower; tune them to the slowest latency your application can tolerate.
Is my password sent anywhere?
No. The entire hash computation runs locally in your browser via WebAssembly -- your password, salt, and resulting hash are never transmitted to a server or stored.