// this one is quite compact and generates 11 random letters+numbers Math.random().toString(36).substring(2) // random output like "0r4q9s1how7" // just change substring() from 2 to 11 to reduce the string