CIN

object CIN(source)

Validator and formatter for Indian Company Identification Numbers (CIN).

CIN is a 21-character Ministry of Corporate Affairs (MCA) code assigned to every company registered in India under the Companies Act. It appears on all corporate filings, invoices, letterheads, and is publicly searchable on the MCA21 portal.

Structure:

[LU][0-9]{5}[A-Z]{2}[0-9]{4}[A-Z]{3}[0-9]{6}
  • Position 0: Listed (L) or Unlisted (U)

  • Positions 1–5: 5-digit NIC 2008 industry code

  • Positions 6–7: 2-letter MCA state code (structural only — see note)

  • Positions 8–11: 4-digit year of incorporation

  • Positions 12–14: 3-letter company class (PTC, PLC, NPL, GAP, GAT, etc.)

  • Positions 15–20: 6-digit MCA registration number

Note on state codes: positions 6–7 accept any 2-letter [A-Z] combination. MCA's authoritative state letter-code list is large and mutable; accepting any 2-letter pair is correct for structural validation. State code semantics are not enforced by this validator.

Accepted input forms (all normalised before validation):

  • Raw uppercase: "U72200KA2013PTC097389"

  • Lowercase: "u72200ka2013ptc097389" — normalised to uppercase

  • Mixed case: "U72200ka2013ptc097389" — normalised to uppercase

  • With spaces: "U72200 KA2013 PTC097389" — internal whitespace stripped

  • Whitespace padded: " U72200KA2013PTC097389 " — trimmed

CIN is a public business identifier publicly searchable on the MCA21 portal — no mask() method is provided. See the KotIndia API design rationale for details.

This object is stateless and thread-safe. No checksum exists for CIN — validation is structural only per MCA specification.

Samples

CIN.validate("L17110MH1973PLC019786") // ValidationResult.Valid
CIN.format("l17110mh1973plc019786") // "L17110MH1973PLC019786"

Functions

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

Formats a CIN to canonical form: 21-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 a Company Identification Number (CIN).