A nonresident alien, in US federal tax law, is an individual who is not a US citizen and who meets neither the green card test nor the substantial presence test. A non-citizen who meets either test is a resident alien and is taxed much like a citizen on worldwide income. The rules are set by the Internal Revenue Code and administered by the Internal Revenue Service (IRS).
A nonresident alien is taxed only on US-source income and on income effectively connected with a US trade or business. Effectively connected income is taxed at the normal graduated rates and reported on Form 1040-NR. Passive US-source income such as dividends is generally subject to a flat 30% withholding tax, collected by the payer, unless a tax treaty lowers it. Individuals usually claim treaty rates by giving the payer Form W-8BEN.