Check if a string is a valid IBAN (International Bank Account Number).
Code
Utilitiesconst normalized = iban.replace(/\s/g, '').toUpperCase();
const rearranged = normalized.slice(4) + normalized.slice(0, 4);
const numericStr = rearranged.replace(/[A-Z]/g, c => (c.charCodeAt(0) - 55).toString());
let remainder = numericStr;
while (remainder.length > 2) {
const block = remainder.slice(0, 9);
remainder = (parseInt(block, 10) % 97).toString() + remainder.slice(9);
}
return parseInt(remainder, 10) % 97 === 1;Parameters
IBAN to validate.
Browser·fetch() may be limited by CORS
More JavaScript Snippets
Check Balanced Brackets
Check if brackets in a string are properly balanced and nested using a stack-based approach.
Check Password Strength
Check if a password meets strength requirements (8+ chars, uppercase, lowercase, number, special).
Get Type
Get the precise type of any value.
Is Alpha Only
Check if a string contains only alphabetic characters.
Is Alphanumeric
Check if a string contains only letters and numbers.
Is Array
Check if a value is an array.