Generate Password

Generate a cryptographically secure random password with configurable options.

Code

Utilities
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' + (includeSymbols ? '!@#$%^&*()_+-=[]{}' : '');
const randomValues = new Uint32Array(length);
crypto.getRandomValues(randomValues);
return Array.from(randomValues, v => chars[v % chars.length]).join('');

Parameters

Password length.

Include special characters.

Browser·fetch() may be limited by CORS

More JavaScript Snippets