Secure random password generation locally in the terminal

For when you just need a quick and secure password 17 May 2026

logo
skypattern.jp Try out Browser-based pattern drafting software for clothing designers. Build custom patterns using mathematical formulas and geometric primitives. Make your free account now!

Generate with data from /dev/random filtering to a safe character set with the tr (transliterate) command.

24 alphanumeric characters without symbols:

echo $(LC_ALL=C  tr -dc 'A-Za-z0-9' < /dev/random | head -c 24)

24 alphanumeric characters with symbols:

echo $(LC_ALL=C  tr -dc 'A-Za-z0-9.!@^*_/' < /dev/random | head -c 24)

Generate a 6-digit numeric PIN code.

echo $(LC_ALL=C  tr -dc '0-9' < /dev/random | head -c 6)

Generate with openSSL output as base64

openssl rand -base64 32