Credit Card Types
Twelve major payment card networks — Visa, Mastercard, American Express, Discover, JCB, Diners Club, UnionPay, Maestro, Mir, Elo, Hipercard, and RuPay — each with their Issuer Identification Number (IIN) ranges, accepted card number lengths, CVV/CVC length, and a regex pattern suitable for real-time client-side card detection.
Quick fetch
Stable URL. CORS-enabled. No auth.
curl https://staticdata.dev/v1/credit-card-types.json
Or use as a typed import:
import { creditCardTypes } from "https://staticdata.dev/v1/credit-card-types.ts"
Formats
- JSON 3.7 KB
/v1/credit-card-types.json
min: 2.5 KB · /v1/credit-card-types.min.json
- CSV 1.8 KB
/v1/credit-card-types.csv
- TypeScript 4.0 KB
/v1/credit-card-types.ts
export const creditCardTypes
type CreditCardType = (typeof creditCardTypes)[number]
Schema
Each record in the dataset has the following shape.
| Field | Type | Description | Example |
|---|---|---|---|
| brand | string | Human-readable card network name | Visa |
| pattern | string | Regex string to match card numbers during input | ^4[0-9]{0,}$ |
| lengths | number[] | Valid full card number lengths | [16] |
| cvvLength | number | Number of digits in the CVV/CVC/CID security code | 3 |
| iinRanges | string[] | IIN/BIN prefix ranges that identify this network | ["51-55"] |
Preview
First 10 records.
| brand | pattern | cvvLength |
|---|---|---|
| Visa | ^4[0-9]{0,}$ | 3 |
| Mastercard | ^(5[1-5][0-9]{0,}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{0,})$ | 3 |
| American Express | ^3[47][0-9]{0,}$ | 4 |
| Discover | ^(6011[0-9]{0,}|64[4-9][0-9]{0,}|65[0-9]{0,}|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[01][0-9]|92[0-5])[0-9]{0,})$ | 3 |
| JCB | ^35(2[89]|[3-8][0-9])[0-9]{0,}$ | 3 |
| Diners Club | ^3(?:0[0-5]|[689][0-9])[0-9]{0,}$ | 3 |
| UnionPay | ^62[0-9]{0,}$ | 3 |
| Maestro | ^(5018|5020|5038|5893|6304|6759|676[1-3])[0-9]{0,}$ | 3 |
| Mir | ^220[0-4][0-9]{0,}$ | 3 |
| Elo | ^(401178|401179|431274|438935|451416|457393|457631|457632|504175|506699|5067[0-6][0-9]|50677[0-8]|509[0-9][0-9]{2}|627780|636297|636368|65003[1-3]|65003[5-9]|65004[0-9]|65005[0-1]|65040[5-9]|6504[1-3][0-9]|65048[5-9]|65049[0-9]|6505[0-2][0-9]|65053[0-8]|65054[1-9]|6505[5-8][0-9]|65059[0-8]|65070[0-9]|65071[0-8]|65072[0-7]|65090[1-9]|6509[1-6][0-9]|65097[0-8]|65165[2-9]|6516[6-7][0-9]|6550[0-1][0-9]|65502[1-9]|6550[3-4][0-9]|65505[0-8])[0-9]{0,}$ | 3 |
Fetch examples
Drop-in snippets in five languages.
curl -sSL https://staticdata.dev/v1/credit-card-types.json | jq '.[0]' import type { CreditCardType } from "https://staticdata.dev/v1/credit-card-types.ts";
const res = await fetch("https://staticdata.dev/v1/credit-card-types.min.json");
if (!res.ok) throw new Error(`Fetch failed: ${res.status}`);
const creditCardTypes: CreditCardType[] = await res.json();
console.log(creditCardTypes[0]); import urllib.request, json
with urllib.request.urlopen("https://staticdata.dev/v1/credit-card-types.min.json") as r:
creditCardTypes = json.load(r)
print(creditCardTypes[0]) package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
resp, err := http.Get("https://staticdata.dev/v1/credit-card-types.min.json")
if err != nil { panic(err) }
defer resp.Body.Close()
var data []map[string]any
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
panic(err)
}
fmt.Println(data[0])
} use serde_json::Value;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let body = ureq::get("https://staticdata.dev/v1/credit-card-types.min.json").call()?.into_string()?;
let data: Vec<Value> = serde_json::from_str(&body)?;
println!("{:?}", data.first());
Ok(())
} Sources and methodology
Card identification relies on the Issuer Identification Number (IIN), historically known as the Bank Identification Number (BIN), which comprises the first six to eight digits of a payment card number. The ranges in this dataset are sourced from the ISO/IEC 7812 standard and network-published documentation from Visa, Mastercard, American Express, Discover, JCB, Diners Club International, UnionPay, Maestro (Mastercard), Mir (Russia’s NSPK), Elo (Brazil), Hipercard (Brazil), and RuPay (India’s NPCI).
The pattern field is a JavaScript-compatible regex intended for progressive (per-keystroke) card type detection as a user types their card number. It is designed to match as soon as enough digits have been entered to unambiguously identify the network, not just on a complete 16-digit number. The lengths array lists every valid fully-formed card length for that network; use it for final length validation after input is complete.
American Express cards use a 4-digit CID printed on the front of the card rather than a 3-digit CVV on the back, reflected in cvvLength: 4. Maestro cards have historically had variable lengths (12–19 digits) due to a variety of issuing banks. Some ranges overlap — Elo’s 4… BINs fall inside Visa’s 4, Discover’s 622126–622925 inside UnionPay’s 62, and Mir’s 2200–2204 sits just below Mastercard’s 2221–2720 — so test the more specific networks before the broad ones. Network rules change over time; ranges reflect commonly published values as of October 2026, and you should always verify against the latest network specifications before use in a production payment flow.
Versioning
URLs under /v1/ are stable: field names and types will not change in a way
that breaks consumers. Values can be corrected or records added when the upstream source
changes; schema-incompatible updates ship under a new version path. See the
credit-card-types changelog for this dataset's history.
Related datasets
More Web datasets
- aria-attributes
- aria-roles
- character-encodings
- csp-directives
- dns-record-types
- dom-events
- emoji
- emoji-shortcodes
- html-elements
- html-entities
- html-attributes
- input-types
- http-auth-schemes
- http-cache-directives
- http-content-codings
- http-headers
- http-methods
- http-status-codes
- http-versions
- iframe-sandbox-tokens
- ip-protocol-numbers
- keyboard-event-codes
- link-relations
- media-type-suffixes
- mime-types
- oauth-grant-types
- ports
- referrer-policies
- ip-special-blocks
- svg-elements
- tcp-flags
- tlds
- tls-cipher-suites
- tls-versions
- uri-schemes
- well-known-uris