Social Security Number (SSN) Generator: Generate and validate US social security numbers. Jacob Allred. This class can be used to generate and validate United States social security numbers. It can generate random numbers for testing purposes based on the social security administration specifications. The numbers do not exist but are well-formed, so they could be valid.