If you are a foreign national who works in the U.S. but is not subject to Social Security or Medicare taxes due to a treaty with your home country, you may request a refund of your Social Security and Medicare taxes from your employer if it mistakenly withheld these taxes from your wages on Form W-2 Wage and Tax Statement.
If your employer does not refund the full amount, you may submit Form 843 Claim for Refund and Request for Abatement to the IRS to claim the balance. You should attach the following documents to Form 843:
For more information, go to the Refund of Taxes Withheld in Error topic on page 39 of IRS Publication 519 U.S. Tax Guide for Aliens.
Note that any link in the information above is updated each year automatically and will take you to the most recent version of the webpage or document at the time it is accessed.