Chile RUT Validator
Validate Chilean RUT (Tax ID) — number + check digit (0-9 or K) computed via mod 11. Accepts dotted/hyphenated format.
RUT (Rol Unico Tributario): Chile's tax identifier
The RUT (Rol Unico Tributario) is the unique tax identifier issued in Chile by the SII (Servicio de Impuestos Internos). It is a numeric body of up to 8 digits followed by a separated check digit, which can be either a decimal digit or the letter K. The RUT covers natural persons, legal entities, foreign investors and even informal taxpayers — it is the single backbone of Chile's tax, payroll, healthcare (Fonasa, Isapres), voting and consumer-facing systems.
In everyday life the RUT and the RUN (Rol Unico Nacional) are almost interchangeable for Chilean citizens: the SII assigns the RUT for fiscal purposes and the Registro Civil prints the same digits on the national ID card as RUN for civil purposes. They share the same algorithm and the same value.
For Brazilian companies expanding into Chile — Mercado Libre, Falabella partnerships, Despegar, B2W and many fintechs — the RUT is the first integration challenge: every invoice (Boleta or Factura Electronica), every payroll record and every Webpay/Khipu transaction is keyed by RUT.
Format: 8 digits + check digit, with optional thousands separators
A RUT is conventionally shown as XX.XXX.XXX-Y, where dots separate thousands and a hyphen separates the check digit Y. The check digit ranges from 0 to 9 or the letter K. Two common representations:
- Display:
12.345.678-5or7.654.321-K. - Storage: stripped of dots and hyphen, e.g.
123456785, often stored as a numeric body plus a separate single-character check field.
Chilean RUTs roughly follow date-of-registration order: an individual born in the 1950s usually has a 7-digit body; people born in the 2020s receive 9-digit bodies. Companies use the same numeric space but conventionally start above 50 million to distinguish them from natural persons.
The mod 11 algorithm with cyclic weights 2-7
The check digit uses a modulo 11 routine with a cycle of weights from 2 to 7, applied right-to-left over the body. Unlike CPF (Brazil) or CUIT (Argentina), the weights are cyclic, allowing arbitrary-length bodies without changing the algorithm.
- Reverse the digits of the body.
- Multiply each digit by the next weight in the cycle 2, 3, 4, 5, 6, 7, 2, 3, 4, ....
- Sum the products.
- Compute
resto = 11 - (sum mod 11). - If
resto == 11, then DV = 0. Ifresto == 10, then DV = K. Otherwise DV equals the decimal digit.
function rutDV(body) {
const w = [2,3,4,5,6,7];
let s = 0, j = 0;
for (let i = body.length - 1; i >= 0; i--) {
s += +body[i] * w[j];
j = (j + 1) % 6;
}
const r = 11 - (s % 11);
if (r === 11) return '0';
if (r === 10) return 'K';
return String(r);
}
Worked example on body 12345678: reversed it is 87654321. Weighted sum = 8*2 + 7*3 + 6*4 + 5*5 + 4*6 + 3*7 + 2*2 + 1*3 = 16+21+24+25+24+21+4+3 = 138. 138 mod 11 = 6. 11 - 6 = 5. So 12.345.678-5 is a valid RUT.
Why the K matters and how to store it
Roughly 1 in 11 RUTs ends in K. Many legacy systems built around DECIMAL columns drop the K, which corrupts ~9% of records on import. The cleanest schema stores the body as integer and the DV as a single CHAR. When serializing to JSON, always emit the DV as a string ("K" or "5"), never as a number — JavaScript's parseInt("K", 10) returns NaN and silently breaks pipelines.
In practice, all open-source libraries (rut.js, rut-helpers, chile-rut) treat the RUT as a string. The SII's official documentation also uses strings.
Where the RUT is mandatory
- Issuing or receiving any Boleta Electronica or Factura Electronica with the SII.
- Declaring IVA, Impuesto a la Renta, Global Complementario.
- Payroll, AFP, salud (Fonasa or Isapre) and Mutual de Seguridad.
- Voting in Chilean elections (the Servel keyed by RUN/RUT).
- Opening a bank account or signing a Cuenta RUT at BancoEstado.
- Driving licence, vehicle registration and notary acts.
- Webpay, Khipu, MercadoPago Chile, Transbank Onepay flows.
- Pre-pago de servicios (Movistar, Entel, WOM, Mall Plaza loyalty cards).
Validation libraries and integration tips
For Node and the browser, mature helpers exist: rut.js, rut-helpers, chile-rut and @fdograph/rut-utilities all implement the mod 11 cyclic-weights routine plus formatting. For Python, python-stdnum provides stdnum.cl.rut. The SII offers the Consulta RUT portal but no public API: integrating against it requires scraping (legally questionable) or a paid bureau such as Equifax Chile, Dicom or NIC.cl.
When validating user input, normalize before storing: strip dots, uppercase the K, and reject lengths outside the valid range (8 or 9 characters including the DV). Always run the check-digit verification on submit, not on every keystroke — Chilean users are used to typing dots themselves.
FAQ
Why is the check digit sometimes K?
Because mod 11 can produce the value 10, which has no decimal representation. The Chilean tax authority chose the letter K (instead of X or a leading zero) so that the check digit always remains a single character.
Is the RUT the same as the RUN?
For natural Chilean citizens, yes — both numbers are identical. RUT is the fiscal label (issued by SII); RUN is the civil label (issued by the Registro Civil). Companies and foreigners may have only a RUT.
Can a foreigner obtain a RUT?
Yes. The SII issues a RUT to foreign individuals and companies that need to invoice in Chile (e.g. Brazilian SaaS selling to Chilean customers). The process is run through the SII's "Investor RUT" or via a Chilean fiscal representative.
Is a RUT enough to issue an invoice?
No. The issuer needs an active SII profile, a certificate digital, and signs each Boleta or Factura with the corresponding XML schema. The receiver's RUT identifies the buyer but does not authorize the transaction by itself.
Does this validator send my RUT to a server?
No. The verification runs entirely client-side. No network request is made and nothing is logged.
Related Tools
CPF Validator
Validate Brazilian CPF numbers instantly using the official algorithm. Useful for testing document validation in applications. No data sent to servers.
Batch CPF Validator
Validate a list of CPFs (one per line) and see which are valid and which are not. No data sent to servers.
Batch CNPJ Validator
Validate a list of CNPJs (one per line) with a summary of valid, invalid and total. No data sent to servers.