The income codes on Form 1042-S are two-digit numbers entered in Box 1 that classify each type of U.S. source income paid to a foreign person. The code you or your withholding agent picks drives three things at once: the default withholding rate in Box 3b, whether a statutory exemption or tax treaty can reduce that rate, and how the recipient reports the income on a U.S. return. A separate 1042-S is required for each income type paid to the same recipient, so different codes cannot be combined on a single form.1Internal Revenue Service. Form 1042-S – Foreign Person’s U.S. Source Income Subject to Withholding
The codes are grouped in rough numerical ranges. Lower numbers cover passive investment income like interest, dividends, and capital gains. Middle numbers cover royalties, pensions, scholarships, and compensation for services. Higher numbers handle specialized categories like substitute payments and artist or athlete earnings. Picking the code is the first step in every 1042-S, because a withholding agent cannot legally apply a treaty benefit or statutory exemption without first identifying the income type.
Interest Codes
Interest is where code selection matters most, because the difference between codes is often the difference between 30% withholding and zero.
Code 01 is the general code for interest paid by U.S. obligors. If a foreign person holds a U.S. bond or deposit and receives interest, this is the default. The withholding rate is 30% unless a treaty lowers it.2Internal Revenue Service. Withholding on Specific Income
Code 30 covers portfolio interest, which is fully exempt from U.S. tax under Sections 871(h) and 881(c). To qualify, the foreign owner generally cannot be a 10% shareholder of the borrower, and the interest must come from certain registered obligations. This exemption is statutory and works even where no treaty exists.3eCFR. 26 CFR 1.871-14 – Rules Relating to Repeal of Tax on Interest of Nonresident Alien Individuals and Foreign Corporations Received From Certain Portfolio Debt Investments
Code 31 applies to interest earned by a foreign central bank on U.S. government obligations or bank deposits. It is exempt under Section 895 as long as the bank is not using the funds in commercial banking activities.4Office of the Law Revision Counsel. 26 U.S. Code 895 – Income Derived by a Foreign Central Bank of Issue From Obligations of the United States or From Bank Deposits
A withholding agent who defaults to Code 01 on what should be portfolio interest forces the recipient to file a U.S. return just to recover the over-withholding. If you are the recipient and your interest qualifies as portfolio interest, confirm with the payer before the form is issued.
Dividend Codes
Code 06 is the standard code for dividends paid by a U.S. corporation and covers most equity distributions to foreign shareholders. The default rate is 30%, and many treaties reduce it to 15% for portfolio investors and 5% for substantial corporate shareholders.2Internal Revenue Service. Withholding on Specific Income
Code 07 covers dividends qualifying for a direct dividend rate. It applies when a foreign corporate shareholder owns enough of the paying company to trigger a lower treaty rate reserved for substantial ownership.
Code 40 handles substitute payments in lieu of dividends. These arise in securities lending and repurchase agreements, where one party compensates another for dividend income they would have received had they still held the stock. Substitute payments carry the same withholding obligations as the underlying dividends.5Internal Revenue Service. Instructions for Form 1042-S
Royalty and Real Property Codes
Royalties get their own cluster because treaties frequently treat different kinds of intellectual property differently. The wrong royalty code can mean applying a 10% treaty rate when the correct rate is zero, or vice versa.
Code 10 is industrial royalties: payments for the use of patents, trademarks, trade secrets, and similar industrial property. Code 11 is narrower and applies specifically to motion picture and television copyright royalties. Code 12 is the catchall for royalties that do not fit in 10 or 11, such as copyright royalties for books and music.1Internal Revenue Service. Form 1042-S – Foreign Person’s U.S. Source Income Subject to Withholding
Code 14 covers real property income and natural resources royalties. Rental income from U.S. real estate paid to a foreign person falls here, as do royalties from mining, oil, and timber rights. This code intersects with FIRPTA rules when real property gains are involved, so a payment that is a gain on disposal rather than rental income is reported differently.
Personal Services Codes
Compensation for personal services is split by the nature of the work.
- Code 17: independent personal services, meaning freelancers, consultants, and self-employed contractors.
- Code 18: dependent personal services, meaning wages, salaries, and other employee pay.
- Code 19: compensation for teaching, used when a foreign teacher or researcher claims a treaty exemption tied to educational activities.
- Code 20: compensation during studying and training, used for stipends, allowances, or wages paid to foreign students or trainees claiming treaty benefits.
The distinction between Codes 19 and 20 matters because treaty provisions for teachers and students typically differ in both duration and dollar limits. A teacher may qualify for a two- or three-year exemption under one treaty article, while a student’s exemption may be capped at a specific annual amount under a different article.6Internal Revenue Service. Instructions for Form 1042-S
An important override sits inside the instructions: if compensation that would otherwise fall under Codes 17 through 20 is directly attributable to the recipient’s work as an artist or athlete, the withholding agent must use Code 42 or 43 instead. Code 42 applies when there is no central withholding agreement in place, and Code 43 applies when one exists. Artist and athlete payments are generally withheld at 30% unless a treaty applies.6Internal Revenue Service. Instructions for Form 1042-S
Other Frequently Used Codes
Several codes outside the interest, dividend, royalty, and services clusters appear regularly:
- Code 09: capital gains, including gains on disposal of timber, coal, or iron ore with a retained economic interest, and gains from contingent payments on patent sales.
- Code 15: pensions, annuities, alimony, and insurance premiums. This is the broad retirement-type distribution code.
- Code 16: scholarship or fellowship grants. The default withholding rate on the taxable portion of a grant is 14% when paid to a nonresident alien on an F, J, M, or Q visa, rather than the standard 30%.7Internal Revenue Service. Federal Income Tax Withholding and Reporting on Other Kinds of U.S. Source Income Paid to Nonresident Aliens
- Code 24: capital gains distributions from a qualified investment entity, such as a real estate investment trust.
- Code 36: capital gains distributions paid by mutual funds or other regulated investment companies.
For 2026, three new codes remain optional: Code 59 for consent fees, Code 60 for loan syndication fees, and Code 61 for settlement payments.5Internal Revenue Service. Instructions for Form 1042-S
How the Code Sets the Withholding Rate
The 30% default rate on U.S. source FDAP income is the starting point for every payment to a foreign person. The income code identifies the payment type. The withholding agent then checks two things: whether a statutory exemption applies (like the portfolio interest exemption sitting behind Code 30) and whether the recipient’s country of residence has a treaty that reduces the rate for that specific income type.2Internal Revenue Service. Withholding on Specific Income
Treaty reductions are not automatic. The foreign recipient must give the withholding agent a valid Form W-8BEN (for individuals) or W-8BEN-E (for entities) claiming the specific treaty article and certifying the country of residence.8Internal Revenue Service. About Form W-8 BEN, Certificate of Foreign Status of Beneficial Owner for United States Tax Withholding and Reporting (Individuals) Without a valid W-8 on file, the withholding agent must apply the full 30% rate no matter what a treaty might allow. This is where compliance most often breaks down: a recipient qualifies for a lower rate, never submits the paperwork, and only realizes it when they are already filing a U.S. return to recover the excess.
When the income is effectively connected with a U.S. trade or business, the flat 30% rate does not apply. The income is taxed on a net basis at the graduated rates that apply to U.S. persons, and the recipient claims this treatment by giving the payer Form W-8ECI. On the 1042-S, the withholding agent still uses the standard income code for the payment type but enters exemption code 01 in Box 3a to flag the different treatment.9Internal Revenue Service. Instructions for Form W-8ECI – Certificate of Foreign Person’s Claim That Income Is Effectively Connected With the Conduct of a Trade or Business in the United States
Box 3a takes a Chapter 3 exemption code that explains why a reduced rate was used. The common ones are Code 01 for effectively connected income, Code 02 for a statutory exemption under the Internal Revenue Code (such as portfolio interest), Code 04 for a treaty-based reduction, and Code 24 for payments to a foreign government or international organization exempt under Section 892. Every 1042-S needs both a Chapter 3 and a Chapter 4 exemption code, so leaving either blank when a reduced rate is claimed is itself an error.6Internal Revenue Service. Instructions for Form 1042-S
If You Received a 1042-S With the Wrong Code
If you are a foreign person who received a 1042-S with the wrong income code, the wrong withholding rate, or wrong dollar amounts, contact the withholding agent first and ask for a corrected form. They can file the correction with the IRS and provide you an updated copy.
If the withholding agent will not cooperate or cannot be reached, you can still file Form 1040-NR to report the correct income and claim credit for the tax that was actually withheld. Attach the 1042-S you received even if it contains errors, because that is how the IRS matches your return to the withholding already reported in its system. The statute of limitations for claiming a refund of over-withheld amounts is three years from the date the 1042-S was issued, so waiting too long means losing the refund.
You need an Individual Taxpayer Identification Number before filing Form 1040-NR if you do not already have one. The ITIN application on Form W-7 can be submitted with the return.