Skip to main content

Generate credit card

This function generates a valid credit card number.

This function requires no extra parameter.

This function applies on String or Long values.

Three types of credit card that can be generated:
  • Visa
  • MasterCard
  • American Express
One type is randomly chosen and a credit card number is randomly generated. Then, the generated credit card number passes algorithms that detect false credit card numbers.

In the following example, the masked value is a valid Visa credit card number, regardless of the input value.

Input value Example of a masked value
A26 4346065537027896

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!