- Validating the RUT format and check digit
- Normalizing different input formats
- Enriching company data using the EnrichLATAM API
RUT structure
A Chilean RUT has the formXXXXXXXX-D, where:
XXXXXXXXis the numeric part (6 to 8 digits)Dis the check digit (0–9orK)
76.354.771-K, 12345678-9, 76354771K
1. Validate the check digit
The check digit is calculated using the Modulo 11 algorithm:2. Normalize the format
In practice, you’ll receive RUTs in different formats. This function normalizes them toXX.XXX.XXX-D: