pseudorandom API
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"}:lengthis the length ofvalueandbitsis 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-. Foralnum,hex,base64url,digits,lower,base32,base58,key,passphrase,pronounceable. lower- Lowercase:
1or0(alsotrue/false); default1. Forpassword. upper- Uppercase:
1or0(alsotrue/false); default1. Forpassword. digits- Digits:
1or0(alsotrue/false); default1. Forpassword. symbols- Symbols:
1or0(alsotrue/false); default1. Forpassword. safe- Safe symbols only:
1or0(alsotrue/false); default0. Forpassword. unambiguous- No look-alikes:
1or0(alsotrue/false); default0. Forpassword. words- Words: a whole number from 1 to 24; leave it out for the default. For
passphrase. wordlist- Word list: one of
long,short; defaultlong. Forpassphrase. capitalize- Capitalize: one of
none,first,all,random; defaultnone. Forpassphrase. digit- Add a digit:
1or0(alsotrue/false); default0. Forpassphrase. 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:
1or0(alsotrue/false); default1. Forpronounceable. upper- Add a capital:
1or0(alsotrue/false); default1. Forpronounceable.
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
- Characters are drawn with
crypto.getRandomValuesand rejection sampling, so none is favoured. - For a password the
bitsfigure is an estimate; requiring every class lowers the true value slightly. - These endpoints are for scripts and tests, and are not indexed by search engines.