Spanish VAT number (NIF-IVA)
Nine characters after the prefix ES. Under Order EHA/451/2008, a company number has a letter for the legal form, seven digits and a check character. A means a stock company, B a limited company, G an association, N a foreign entity and W a permanent establishment of a non-resident.
Individuals use their DNI or NIE number with a letter, and the Ministry of the Interior publishes that rule. The order does not explain how companies' check characters are computed, so ours rests on public descriptions.