idnumbers
    Preparing search index...

    The Social Security Number of United States. This page is generated from the registry metadata of the library.

    Property Value
    Country code USA, US
    ID type Social Security Number
    Official name Social Security Number (SSN)
    Also known as Social Security number; SSN
    Display format ###-##-####
    Input masks ###-##-####
    Length 9
    Example 123-45-6789
    Checksum no
    Checksum algorithm None (area/group/serial rules only)
    Parsable no

    The root entry registers every country:

    import { validateNationalId } from 'idnumbers';

    validateNationalId('USA', '123-45-6789').isValid; // true

    To bundle only this country, import its definition from idnumbers/countries/usa and pass it to register():

    import { register, validateNationalId } from 'idnumbers/core';
    import { country } from 'idnumbers/countries/usa';

    register(country);
    validateNationalId('USA', '123-45-6789').isValid; // true