The API generates on the server. For anything secret, use the generator instead: it makes each string in your browser and sends nothing anywhere.

Endpoints

/text
One string as plain text, with no trailing newline.
/json
The same options, returning {"value","format","length","bits"}: length is the length of value and bits is its entropy.

Both take GET or HEAD, send Access-Control-Allow-Origin: * and Cache-Control: no-store, and take the same options as query parameters.

Examples

curl 'https://pseudorandom.io/text'
curl 'https://pseudorandom.io/text?format=hex&length=16'
curl 'https://pseudorandom.io/text?format=password&length=24&symbols=0'
curl 'https://pseudorandom.io/text?format=passphrase&words=5&separator=space'
curl 'https://pseudorandom.io/json?format=base58&length=12'

Formats

Choose one with format (default alnum).

digits
Digits (0-9). Options: length, group, separator.
hex
Hex (lowercase). Options: length, group, separator.
base32
Base32 (A-Z, 2-7). Options: length, group, separator.
lower
Lowercase and digits (a-z, 0-9). Options: length, group, separator.
base58
Base58 (no 0, O, I or l). Options: length, group, separator.
alnum
Alphanumeric (a-z, A-Z, 0-9). Options: length, group, separator.
base64url
Base64url (A-Z, a-z, 0-9, - and _). Options: length, group, separator.
pronounceable
Pronounceable (readable syllables). Options: separator, syllables, group, digit, upper.
passphrase
Passphrase (random words). Options: separator, words, wordlist, capitalize, digit.
key
Key (capitals and digits, no look-alikes), grouped. Options: length, group, separator.
password
Password (choose character classes). Options: length, lower, upper, digits, symbols, safe, unambiguous.
uuid
UUID v4 (fixed length). No options.

Options

All options are optional. An option that does not apply to the chosen format is ignored. The default length is 32 (20 for key and password), and length must be 1 to 1024.

format
One of the formats above.
length
Length: a whole number from 1 to 1024; leave it out for the default. For alnum, hex, base64url, digits, lower, base32, base58, key, password.
group
Group size: a whole number from 2 to 64; leave it out for the default. For alnum, hex, base64url, digits, lower, base32, base58, key.
separator
Separator: one of -, ., _, ,, space, none; default -. For alnum, hex, base64url, digits, lower, base32, base58, key, passphrase, pronounceable.
lower
Lowercase: 1 or 0 (also true / false); default 1. For password.
upper
Uppercase: 1 or 0 (also true / false); default 1. For password.
digits
Digits: 1 or 0 (also true / false); default 1. For password.
symbols
Symbols: 1 or 0 (also true / false); default 1. For password.
safe
Safe symbols only: 1 or 0 (also true / false); default 0. For password.
unambiguous
No look-alikes: 1 or 0 (also true / false); default 0. For password.
words
Words: a whole number from 1 to 24; leave it out for the default. For passphrase.
wordlist
Word list: one of long, short; default long. For passphrase.
capitalize
Capitalize: one of none, first, all, random; default none. For passphrase.
digit
Add a digit: 1 or 0 (also true / false); default 0. For passphrase.
syllables
Syllables: a whole number from 1 to 12; leave it out for the default. For pronounceable.
group
Syllables per group: a whole number from 1 to 12; leave it out for the default. For pronounceable.
digit
Add a digit: 1 or 0 (also true / false); default 1. For pronounceable.
upper
Add a capital: 1 or 0 (also true / false); default 1. For pronounceable.

Errors

A bad option returns status 400 with a message, never a silently changed value: Error: ... as plain text from /text, and {"error": "..."} from /json.

Notes