Skip to main content

Passphrase Generator API

MOCK DATA

Diceware-style random passphrases from a curated 895-word English list — pick word count, separator and capitalization, with an honest entropy estimate.

Generated test data for fixtures and development

Base URL
/api/passphrases
Capabilities
1 route Seedable
Last updated
July 29, 2026

GET /api/passphrases

Live requestRuns against the public API
No key required
GET/api/passphrases?count=5&seed=42

Request parameters

Number of words per passphrase (3–10). More words = more entropy (~9.8 bits each).

String placed between words, up to 3 characters (e.g. '.', '_', '--'). An empty value falls back to the default '-'.

Title Case every word (Correct-Horse-Battery). Formatting only — entropy is unchanged.

Advanced response options7 options

How many records to generate (1–100).

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/passphrases?count=5&seed=42"
const res = await fetch("https://randomapi.dev/api/passphrases?count=5&seed=42");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/passphrases?count=5&seed=42").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/passphrases?count=5&seed=42"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 3
words int

Number of words per passphrase (3–10). More words = more entropy (~9.8 bits each).

default: 4
allowed: 3 – 10
example: words=5
separator string

String placed between words, up to 3 characters (e.g. '.', '_', '--'). An empty value falls back to the default '-'.

default: -
allowed: 0 – 3
example: separator=.
capitalize boolean

Title Case every word (Correct-Horse-Battery). Formatting only — entropy is unchanged.

default: false
example: capitalize=true
Universal parameters Shared response and formatting options 7
count int

How many records to generate (1–100).

default: 10
allowed: 1 – 100
example: count=3
seed int

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

example: seed=42
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=passphrase,words
exclude list

Return all fields except these (comma-separated).

example: exclude=entropyBits
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 3
passphrase string

The words joined with the separator — exactly words.join(separator).

example: ember-lagoon-violin-frost

words string[]

The individual words, in order, as they appear in the passphrase (Title Cased when capitalize=true).

example: ["ember","lagoon","violin","frost"]

entropyBits integer

Strength estimate: round(words × log2(895)) — each word is an independent uniform pick from the 895-word list (≈9.8 bits per word).

example: 39

Documented examples

Build-generated requests and complete responses
3
Five reproducible passphrases
GET /api/passphrases?count=5&seed=42
{
  "data": [
    {
      "passphrase": "lizard-raccoon-panther-fresh",
      "words": [
        "lizard",
        "raccoon",
        "panther",
        "fresh"
      ],
      "entropyBits": 39
    },
    {
      "passphrase": "banana-almond-lake-mirror",
      "words": [
        "banana",
        "almond",
        "lake",
        "mirror"
      ],
      "entropyBits": 39
    },
    {
      "passphrase": "swan-carry-glade-leopard",
      "words": [
        "swan",
        "carry",
        "glade",
        "leopard"
      ],
      "entropyBits": 39
    },
    {
      "passphrase": "clear-order-bagel-cookie",
      "words": [
        "clear",
        "order",
        "bagel",
        "cookie"
      ],
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Six words, dot-separated (~59 bits)
GET /api/passphrases?words=6&separator=.
{
  "data": [
    {
      "passphrase": "lizard.raccoon.panther.fresh.mist.bamboo",
      "words": [
        "lizard",
        "raccoon",
        "panther",
        "fresh",
        "mist",
        "bamboo"
      ],
      "entropyBits": 59
    },
    {
      "passphrase": "banana.almond.lake.mirror.yak.comet",
      "words": [
        "banana",
        "almond",
        "lake",
        "mirror",
        "yak",
        "comet"
      ],
      "entropyBits": 59
    },
    {
      "passphrase": "swan.carry.glade.leopard.noodle.alert",
      "words": [
        "swan",
        "carry",
        "glade",
        "leopard",
        "noodle",
        "alert"
      ],
      "entropyBits": 59
    },
    {
      "passphrase": "clear.order.bagel.cookie.walrus.studio",
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Title Case for readability
GET /api/passphrases?words=5&capitalize=true
{
  "data": [
    {
      "passphrase": "Lizard-Raccoon-Panther-Fresh-Mist",
      "words": [
        "Lizard",
        "Raccoon",
        "Panther",
        "Fresh",
        "Mist"
      ],
      "entropyBits": 49
    },
    {
      "passphrase": "Banana-Almond-Lake-Mirror-Yak",
      "words": [
        "Banana",
        "Almond",
        "Lake",
        "Mirror",
        "Yak"
      ],
      "entropyBits": 49
    },
    {
      "passphrase": "Swan-Carry-Glade-Leopard-Noodle",
      "words": [
        "Swan",
        "Carry",
        "Glade",
        "Leopard",
        "Noodle"
      ],
      "entropyBits": 49
    },
    {
      "passphrase": "Clear-Order-Bagel-Cookie-Walrus",
      "words": [
        "Clear",
        "Order",
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}

About this API

Coverage & behavior

Generates memorable word-based passphrases (the correct-horse-battery-staple pattern) from a curated list of 895 common English words, each 3–8 lowercase letters — no proper nouns, no obscure vocabulary.

Every word is an independent uniform pick from the full list (duplicates within a passphrase are possible, exactly like rolling dice), so the strength math is honest: entropyBits = round(words × log2(895)) ≈ 9.8 bits per word. separator and capitalize only change formatting, never entropy.

With a seed the same request returns the same passphrases forever — handy for fixtures. Do not use seeded output as a real credential; for real passphrases let the platform pick a fresh random seed (the default) or, better, generate secrets offline.

Use it for

  • Suggest memorable passphrases in a sign-up or password-reset flow
  • Generate human-readable one-time codes, Wi-Fi keys or room names
  • Seed test fixtures with realistic credential-like strings (never real secrets)

Frequently asked questions

How strong are the passphrases?

Each response includes entropyBits computed from the wordlist size and length, so you can enforce a policy numerically.

Should I use these as real passwords?

Not for personal credentials — anything generated over a public HTTP API belongs in test accounts and demos. Use a local generator for real secrets.

Can I format them?

words sets the word count, separator the joiner and capitalize=true title-cases each word.

Standards & references