United States ZIP Code (%USZIP) Macro

Applies to ReadyAPI 3.53, last modified on June 07, 2024

The United States ZIP Code macro is used to insert United States ZIP codes into the strings generated by a data source using the Custom String data generator.

The macro is an analog of the United States ZIP Code data generator.


The macro has the following syntax:




Specifies the format of the ZIP codes that will be generated.

Available values of the parameter:

  • XXXXX – generates five digits ZIP codes.

  • XXXXX-XXXX – generates ZIP+4 codes.

  • All – Default. Generates five digits ZIP and ZIP+4 codes.

The parameter is case-sensitive.


The following examples demonstrate how to use the United States ZIP Code macro:

  • ZIP Code: %USZIP(All)

    Example: United States ZIP Code macro in Data Generator

    Click the image to enlarge it.

    Generates a string containing a ZIP code in the XXXXX or XXXXX-XXXX format.


    Generates ZIP+4 codes.

  • %USZIP(xxxxx) <- Invalid value

    The parameter is case-sensitive, so ReadyAPI will not parse the custom string.


For more information on adding macros to custom strings, see About Custom String Generator.

For more information on general rules used for specifying macro parameters, see Custom String Generator Rules.

See Also

United States ZIP Code Generator
Custom String Generator
Macro Reference

Highlight search results