Calculate/validate a Spanish DNI, NIE or CIF check character
validate_spanish_tax_idTwo modes in one input. If valor is only 1-8 digits, computes the DNI check letter and returns the full 8-digit-plus-letter DNI (digits are left-padded with zeros). If valor is a full document, validates its check character: DNI (8 digits + letter), NIE (X/Y/Z + 7 digits + letter) or CIF (entity letter + 7 digits + check digit or letter, with the entity type per Orden EHA/451/2008). Tolerates spaces, dots, dashes and an ES prefix. Pure arithmetic: it does NOT confirm the document exists, is active or belongs to the person who gave it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| valor | Yes | 1-8 digits, or a full DNI/NIE/CIF |