Card number (Luhn) and IBAN validator
Check a card number with the Luhn checksum and name its network, or check an IBAN by length and mod-97.
Input
Result
Fill in the input and press Run.
Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.
Use it from code or an agent
curl -s https://setget.net/v1/tools/luhn-iban-validate \
-H 'Content-Type: application/json' \
-d '{"input":{"value":"GB82 WEST 1234 5698 7654 32"}}'
import json, urllib.request
body = {'input': {'value': 'GB82 WEST 1234 5698 7654 32'}}
request = urllib.request.Request("https://setget.net/v1/tools/luhn-iban-validate", json.dumps(body).encode(),
{"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/luhn-iban-validate", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({"input":{"value":"GB82 WEST 1234 5698 7654 32"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
"slug": "luhn-iban-validate",
"input": {
"value": "GB82 WEST 1234 5698 7654 32"
}
}
{
"input": {
"value": "GB82 WEST 1234 5698 7654 32"
}
}
Endpoint: POST /v1/tools/luhn-iban-validate. Over MCP: run_tool with slug: "luhn-iban-validate".
Machine-readable: input schema, Markdown. Connect an agent.
Inputs
| Name | Type | Required | What it does |
|---|---|---|---|
value |
string | yes | The card number or IBAN. Spaces and hyphens are ignored. |
kind |
string | no | What the value is. "auto" decides from its first characters. One of: auto, card, iban. Default: "auto". |
Examples
Input
{
"value": "GB82 WEST 1234 5698 7654 32"
}Result
{
"kind": "iban",
"valid": true,
"country": "GB",
"check_digits": "82",
"bban": "WEST12345698765432",
"length": 22,
"expected_length": 22,
"checksum_valid": true,
"formatted": "GB82 WEST 1234 5698 7654 32",
"problems": []
}A well-known Visa test number
Input
{
"value": "4111 1111 1111 1111"
}Result
{
"kind": "card",
"valid": true,
"network": "Visa",
"length": 16,
"luhn_valid": true,
"length_valid": true,
"last4": "1111",
"masked": "************1111",
"problems": []
}Questions
- Does a valid result mean the card or account exists?
- No. It only means the number is well formed. Nothing is looked up and no bank or card network is contacted.
- Is my card number stored or shown?
- The result repeats only the last four digits. Use published test numbers rather than a real card wherever you can.
- How is the network found?
- From the first digits and the length. Ranges overlap in places, so treat it as a best guess.
Related tools
- Email address syntax checkerCheck the syntax of an email address, normalise it and flag likely typos, role and disposable addresses.
email-syntax - .gitignore testerCheck which paths a .gitignore file ignores and which line decided each one, using real Git matching rules.
gitignore-test - Cache-Control explainerExplain a Cache-Control header directive by directive and how browsers and CDNs will treat the response.
cache-control-explain - CIDR and subnet calculatorWork out the network, netmask, host range and size of an IPv4 or IPv6 CIDR block, and split it into subnets.
cidr-calc - Cookie parserParse Cookie and Set-Cookie headers into JSON, with warnings about missing security attributes.
cookie-parse - CSS formatterPretty-print minified or messy CSS with one declaration per line and nested @media blocks indented.
css-format