DevTools Logo

Argon2 Hash Generator & Verifier

Argon2 Hash Generator & Verifier

Generate Argon2id/2i/2d PHC hashes and verify stored hashes — reference algorithm, entirely in your browser.

Runs in your browser
Version 0x13 (v=19) · RFC 9106 / OWASP presets
Try an example

Password & parameters

argon2id · 65536 KiB · t=3 · p=4

m is the total memory across all lanes (not per lane). RFC 9106 recommends 65536 KiB with t=3, p=4.

Mod+Enter runs · Mod+Shift+Enter copies · Mod+Shift+X clears

PHC hash & parity

waiting

Set a password and generate a hash

Argon2 runs locally — nothing is uploaded or stored.

What m, t and p actually mean

m is total memory in KiB, rounded down to a multiple of 4×p. It dominates brute-force cost; 19456 KiB is OWASP's minimum and 65536 KiB is RFC 9106's second recommendation.

t is the number of passes over memory. p is the number of lanes; it changes parallelism, not the memory per hash. Salt and tag lengths are byte counts.

RAM per concurrent hash: about 64 MiB. Strength heuristic: Strong — Meets the RFC 9106 64 MiB / t=3 tier.

Versions: v=19 is Argon 2.1.3 with XOR across passes; legacy v=16 hashes are re-derived with their own version byte. Password text is UTF-8 encoded, matching PHP's raw-byte behaviour; NUL bytes are preserved as typed.

Details

Argon2 is the memory-hard password hashing function standardised in RFC 9106. This tool runs the reference algorithm locally: pick Argon2id, Argon2i or Argon2d, set memory (m), iterations (t), parallelism (p), salt length and tag length, and get the standard PHC string plus the equivalent PHP password_hash and reference CLI commands. You can also paste an existing $argon2… hash to check a candidate password without sending either value anywhere. Presets cite OWASP and RFC 9106; sliders stay authoritative.

Generate an Argon2id PHC hash

Variant: argon2id · m=65536 KiB · t=3 · p=4
Password: hunter2
Output: $argon2id$v=19$m=65536,t=3,p=4$<base64 salt>$<base64 tag>

RFC 9106's second recommendation (64 MiB, 3 passes, 4 lanes) with a 16-byte CSPRNG salt and 32-byte tag.

Verify a stored PHP hash

Stored: $argon2id$v=19$m=19456,t=2,p=1$<salt>$<tag>
Candidate: correct horse battery staple
Result: Password matches / No match

The stored salt and cost fields are reused exactly; the candidate is UTF-8 encoded and compared in constant time.

CLI parity without exponent confusion

printf %s 'hunter2' | argon2 $'\x73\x6f...' -id -t 3 -k 65536 -p 4 -l 32

The reference argon2 CLI's -k flag takes KiB; -m takes a base-2 exponent and is not equivalent to the PHC m field.

PHP password_hash equivalent

password_hash($password, PASSWORD_ARGON2ID, ['memory_cost' => 65536, 'time_cost' => 3, 'threads' => 4]);
password_verify($password, $hash);

PHP accepts the same cost fields; password_verify checks any stored Argon2 hash the runtime supports.

    Examples

    RFC 9106 second recommendation

    Input
    argon2id · m=65536 · t=3 · p=4 · password=hunter2
    Output
    $argon2id$v=19$m=65536,t=3,p=4$<16-byte base64 salt>$<32-byte base64 tag>

    64 MiB, three passes and four lanes — the standard memory-constrained recommendation.

    Fast reference hash for tests

    Input
    argon2id · m=32 · t=3 · p=4 · password=hunter2 · salt=somesalt12345678
    Output
    $argon2id$v=19$m=32,t=3,p=4$c29tZXNhbHQxMjM0NTY3OA$nYX1rsa7D4Ecxj7mSRSNq01eN6Nhau+L9TL9639NnzM

    A fixed, reproducible vector used by the tool's one-click round trip; never use m=32 for real credentials.

    PHP parity

    Input
    password_hash($password, PASSWORD_ARGON2ID, ['memory_cost' => 19456, 'time_cost' => 2, 'threads' => 1])
    Output
    password_verify($password, $hash) → true / false

    The generated PHP snippet uses the same cost fields; password_verify accepts the resulting PHC string.

    About this tool

    Argon2 is the memory-hard password hashing function standardised in RFC 9106. This generator runs the reference algorithm locally: choose Argon2id, Argon2i or Argon2d, tune memory (m), passes (t), lanes (p), salt length and tag length, and receive the standard PHC string used by PHP, Node and the reference CLI.

    The parameter controls are deliberately explicit. Memory is the total number of kibibytes used by all lanes, not a per-lane value; iterations are full passes over memory; parallelism is the number of independent lanes. Presets quote OWASP and RFC 9106 with their sources, but the sliders remain authoritative so you can reproduce an existing hash exactly.

    Verification pastes an existing $argon2… string and re-derives the tag with the stored variant, version, salt and cost fields. The comparison is a constant-time XOR fold, and no password or hash is transmitted or stored — hashing runs in a worker in this browser tab.

    What this tool does not do

    • RFC 9106's first recommendation (2 GiB, t=1, p=4) is capped at 1 GiB in the browser; use the CLI for the full setting.
    • The tool hashes and verifies only Argon2 PHC strings — bcrypt, scrypt and PBKDF2 are separate tools.
    • Secret and associated-data inputs from the RFC are supported by the core but not exposed in the UI.
    • Batch verification is limited to 200 rows per run to keep memory and time bounded.
    • This is not a password strength auditor and does not store hashes; very large m values can fail on low-memory devices.

    How to use this tool

    1. Choose a mode and preset

      Generate creates a new hash; Verify checks a candidate against an existing PHC string; Batch checks a list. Start from an OWASP or RFC 9106 preset or set the cost fields yourself.

    2. Set m, t and p

      Memory is in KiB across all lanes, t is the number of passes (1–10 here) and p is the lane count (1–8 here). Lower values run faster; higher values cost attackers more.

    3. Enter the password

      Type the password (reveal it if needed) and optionally supply a fixed base64 salt. Blank salt means 16 bytes from crypto.getRandomValues.

    4. Run and inspect

      Press Generate hash or Mod/Ctrl+Enter. The output shows the PHC string, decoded fields, a reference CLI command and a PHP password_hash / password_verify snippet.

    5. Copy or verify

      Copy the PHC string for your docs or database. To check it, switch to Verify, paste the hash and candidate, and read the match banner.

    Use cases

    Check a stored hash

    Paste a hash from your database and a candidate password to see whether they match, without installing libargon2.

    Choose parameters

    Compare OWASP and RFC 9106 presets, then see the RAM budget for the number of concurrent logins your server handles.

    Write test fixtures

    Produce deterministic PHC strings with a fixed salt for unit tests and documentation, plus the CLI command that reproduces them.

    PHC fields and parameter meanings

    FieldMeaning
    $argon2id / $argon2i / $argon2dVariant: hybrid (default), data-independent or data-dependent addressing
    v=19Argon2 1.3 version byte 0x13; legacy v=16 is re-derived with its own version
    m=65536Total memory in KiB, rounded down to a multiple of 4×p — 64 MiB here
    t=3, p=4Three passes over memory, four lanes; p does not multiply the m budget
    $<salt>Unpadded base64 salt; 16 bytes is recommended and the default here
    $<tag>Unpadded base64 tag; 32 bytes is the default and RFC minimum for most uses

    Example: $argon2id$v=19$m=65536,t=3,p=4$c29tZXNhbHQ…$… — the same format PHP's password_hash emits.

    Common mistakes

    Mistake:Passing m=65536 as `argon2 -m 65536`.

    Fix:The CLI's -m flag is a base-2 exponent; use -k 65536 (or -m 16) for 64 MiB. The emitted parity command uses -k.

    Mistake:Budgeting p × m MiB of RAM per hash.

    Fix:Argon2's m is the total memory across all lanes. Provision roughly m KiB per concurrent hash, not m×p.

    Mistake:Comparing tag strings with a normal equality check.

    Fix:Use a constant-time comparison (as verification here does) to avoid leaking match position through timing.

    Mistake:Generating salts with Math.random().

    Fix:Salts come from crypto.getRandomValues by default. Reuse a stored salt only when verifying an existing hash.

    Frequently asked questions

    Which Argon2 variant should I use?

    Argon2id is the default and the right choice for almost every password hashing job: it uses data-independent addressing for the first half of the first pass and data-dependent addressing afterwards, balancing side-channel resistance against trade-off attacks. Argon2i is a data-independent alternative; Argon2d is faster but vulnerable to side channels and is meant for proof-of-work, not passwords.

    What do m, t and p mean?

    m is the total memory budget in kibibytes (rounded down to a multiple of 4×p), t is the number of full passes over that memory, and p is the number of parallel lanes. m is not per lane — a hash with m=65536 and p=4 still needs about 64 MiB, not 256 MiB. Salt and tag lengths are byte counts, with 16 and 32 bytes recommended.

    What parameters does OWASP recommend?

    The OWASP Password Storage Cheat Sheet lists Argon2id with m=19456 KiB (19 MiB), t=2 and p=1 as its minimum configuration. RFC 9106 additionally recommends t=1, p=4 with 2 GiB as its first option and t=3, p=4 with 64 MiB as its second option for memory-constrained environments. The tool offers all of these as labelled presets; this browser caps the 2 GiB option at 1 GiB.

    Is my password sent anywhere?

    No. The Argon2 reference algorithm runs in a worker inside this browser tab. Nothing is uploaded, logged or stored, and the generated hash is only held in memory until you reload or clear the tool.

    How do I verify a hash?

    Switch to Verify, paste the full $argon2… PHC string and type the candidate password, then press Verify password (or Mod/Ctrl+Enter). The tool parses the stored variant, version, salt and cost fields, re-derives the tag with exactly those values and compares it with a constant-time XOR fold. A mismatch is reported in neutral wording — it does not reveal which field differed.

    Can I reproduce this in PHP?

    Yes. The output includes a password_hash snippet using PASSWORD_ARGON2ID with the same memory_cost, time_cost and threads values. Check the result with password_verify($password, $hash). PHP supports Argon2i and Argon2id but not Argon2d in its standard build.

    What about legacy v=16 hashes?

    Version 16 predates Argon2 1.3 and uses a different finalisation rule. The verifier reads the v field, derives with that same version byte and shows a warning; a v=16 hash still verifies correctly instead of silently being re-derived as v=19. Version-less hashes are treated as v=16 with a warning.

    References & standards