Credit Card Formatter
Format raw card numbers with correct spacing for each card type.
Related Tools
FAQ
- Why do Amex cards have a different format?
- American Express cards use a 4-6-5 spacing format (e.g., 3782 822463 10005) compared to the standard 4-4-4-4 used by Visa, Mastercard, and Discover. This is because Amex cards are 15 digits long while most other cards are 16 digits.
- Does formatting change the card number?
- No. Formatting only adds spaces for display purposes. The underlying digits are not modified. You can copy the formatted version and still use it anywhere a raw card number is expected — the spaces will typically be ignored by payment systems.
- What card types are supported?
- The formatter supports Visa (16 digits, 4-4-4-4), Mastercard (16 digits, 4-4-4-4), American Express (15 digits, 4-6-5), and Discover (16 digits, 4-4-4-4). Unknown card types default to 4-4-4-4 grouping.
Format raw credit card number strings with the correct spacing pattern for each card network. Visa, Mastercard, and Discover use the 4-4-4-4 format, while American Express uses 4-6-5. Auto-detects the card type from the BIN prefix and applies the appropriate format. Useful for displaying card numbers in UI components or payment receipts.