Transforms raw credit card numbers into standardized, readable formats with proper spacing. Access via MCP in Cursor or Windsurf, or call GET /v1/format/credit-card directly. Input "4111111111111111" returns "4111 1111 1111 1111". Handles all major card types with their specific grouping patterns.
curl "https://tinyfn.io/v1/format/credit-card" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/format/credit-card', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/format/credit-card',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's formatting tools:
{
"mcpServers": {
"tinyfn-format": {
"url": "https://tinyfn.io/mcp/format",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Use the format_credit_card tool in your MCP-enabled editor with the card number as input. It automatically detects the card type and applies the correct spacing pattern.
Supports Visa, Mastercard, American Express, Discover, and other major card types. Each gets its standard grouping: 4-4-4-4 for most cards, 4-6-5 for Amex.
No, it only formats the spacing. It doesn't validate checksums, expiration dates, or whether the number is real. Use a separate validation tool for security checks.
Yes, it formats any numeric input with appropriate spacing based on length and detected pattern. Incomplete numbers get formatted as far as possible.
GET /v1/format/credit-card with the card number as a parameter. Returns the formatted number with proper spacing for display purposes.
Get your free API key and start using Format Credit Card in seconds.
Get Free API Key