Describe one payment to a foreign person and get the chapter 3 rate and tax, whether FATCA (chapter 4) withholding applies, and the Form 1042-S codes: income code, exemption codes, rates and the recipient's status codes. Treaty rates come from the IRS treaty tables.
One payment, one recipient. The tool applies the general rules in Publication 515 and the IRS treaty tables; it cannot see the payee's facts, and special regimes (QIs, withholding partnerships, real property dispositions, gambling, wages) are outside it.
How the calculator decides
Source. Services are sourced where performed; royalties where the property is used; interest and dividends by the payer; rent by the property's location. Foreign-source income is outside chapter 3: no withholding, no 1042-S.
Chapter 3 rate. 30%, unless the certificate supports a treaty rate (exemption code 04), effectively connected income on a W-8ECI (01), portfolio interest (05), or the 14% scholarship rate for F, J, M and Q visa holders (02).
Chapter 4. Services, royalties, rent, scholarships and payments to individuals are not withholdable payments, or chapter 4 does not apply. For interest and dividends to an entity, the chapter 4 status decides; where chapter 4 withholding applies, it is 30% and satisfies chapter 3 (chapter 3 exemption code 12).