IFSC

object IFSC(source)

Validator and formatter for Indian Financial System Codes (IFSC).

IFSC is an 11-character RBI-assigned code identifying a specific bank branch for NEFT, RTGS, IMPS, and UPI transactions.

Format: [A-Z]{4}0[A-Z0-9]{6}

  • Characters 1–4: bank code (uppercase letters)

  • Character 5: always 0 (reserved by RBI for future use)

  • Characters 6–11: branch code (uppercase alphanumeric)

Accepted input forms (all normalised before validation):

  • Raw uppercase: "HDFC0000001"

  • Lowercase: "hdfc0000001" — normalised to uppercase

  • Mixed case: "HdFc0000001" — normalised to uppercase

  • With spaces: "HDFC 0000 001" — internal whitespace stripped

  • Whitespace padded: " HDFC0000001 " — leading/trailing whitespace trimmed

IFSC is a public bank routing code published and distributed by RBI — no mask() method is provided. See the KotIndia API design rationale for details.

This object is stateless and thread-safe. No checksum exists for IFSC — validation is structural (format) only per RBI specification.

Samples

IFSC.validate("HDFC0000001") // ValidationResult.Valid
IFSC.format("hdfc0000001") // "HDFC0000001"

Functions

Link copied to clipboard
fun format(value: String): String

Formats an IFSC to canonical form: 11-character uppercase, no separators.

Link copied to clipboard
fun isValid(value: String): Boolean

Returns true if validate returns ValidationResult.Valid.

Link copied to clipboard

Validates an Indian Financial System Code (IFSC).