It forks: if you are still a doing authorized, degree-related OPT, Social Security and Medicare should not be withheld; if you are a resident alien for that tax year, they are generally due.
“I am an F1 OPT student working on a W-2 for a staffing firm. My employer is withholding FICA and Medicare taxes from my paychecks. I explained that F1 students are exempt for the first 5 years, but payroll refused to stop the deductions, claiming there is no exemption. What can I do to stop this or get a refund?”
Summary
Payroll’s blanket statement that no exemption exists is wrong: current federal law expressly provides one for qualifying F‑1 nonresident work. Once you identify the correct residency branch, there is a clear employer‑first process and an IRS backup claim.
Your answer forks on your federal tax residency for each affected year and whether the OPT job is authorized and related to your degree.
If you are a and the work is authorized, degree-related OPT, IRC 3121(b)(19) excludes the service from . The IRS expressly lists practical-training employment on or off campus, so payroll should stop Social Security and Medicare withholding and repay amounts taken in error.
The sixth year does not automatically make the tax due. You can still be nonresident if you do not meet the , or if the IRS accepts the narrow IRC 7701(b)(5)(E)(ii) exception after you establish no permanent-residence intent and substantial status compliance on Form 8843 with the required statement.
If you meet the after your excluded student years and have not established the beyond-five exception, the F-1 nonresident exemption no longer applies and the withholding is generally correct. The different school-employee exemption does not help when the W-2 employer is a staffing firm rather than your school.
Being paid on a W-2 by a staffing firm does not itself cancel IRC 3121(b)(19); the decisive facts are your nonresident status and qualifying F-1 work.
Read the full explanationHide the full explanation
Watch out for
Next steps
These steps establish whether the exemption applies, stop future deductions, and recover each still-open year without a duplicate claim.
Before demanding a refund
Classify your tax residency for each affected year
Count calendar years, including a partial first year. During qualifying student years, your days are excluded as an . After the fifth counted year, apply the : at least 31 current-year days and 183 weighted days using all current-year days, one-third of prior-year days, and one-sixth of second-prior-year days. If you rely on the narrow beyond-five exception, attach Form 8843 and its no-permanent-residence-intent statement to your income-tax return; do not simply claim that every F-1 student is automatically exempt for five rolling years.
Requirements
Before contacting payroll
Confirm that the staffing job is valid OPT
Match the job dates to your EAD and document the logical connection between the duties and your major. If this is STEM OPT and an agency merely placed you at another company, the actual E-Verify training employer must sign the I-983; prepare a new I-983 for each new training opportunity.
Requirements
Do this now for ongoing withholding
Send payroll a written stop-and-refund request
State that you are a , the OPT work is authorized and degree-related, and IRC 3121(b)(19) excludes it from . Ask payroll to stop both Social Security and Medicare withholding, reimburse the employee amounts already taken, and confirm the correction in writing. The employer can correct its employment-tax return through Form 941-X; for a prior-year repayment it must give you Form W-2c correcting Social Security and Medicare wages and taxes. If payroll refuses, request a statement showing any amount reimbursed and any credit or refund it claimed or you authorized; if it will not provide one, retain the refusal and explain that on .
Requirements
If the employer will not fully repay you
Mail a separate IRS refund claim for each open year
On , select the employee refund reason for excess Social Security/Medicare withheld by one employer that will not adjust it; enter the tax period, refund amount, payment dates, employment-tax type, and a line-8 explanation and computation. Prepare one form per year, attach the listed copies, sign both forms, and mail the package to Department of the Treasury, Internal Revenue Service Center, Ogden, UT 84201-0038. The forms state no filing fee; send no payment. File by the later of three years after the original return was filed or two years after the tax was paid; if no return was filed, use the statutory two-year-from-payment limit.
Requirements
Legal sources
The answer rests on the Internal Revenue Code and Treasury regulation, current IRS publications and forms, and DHS/ICE OPT guidance.
IRC 3121(b)(19)
The Code removes qualifying F‑1 nonresident services from employment subject to Social Security and Medicare taxes.
§3121(b)(19)
Service which is performed by a nonresident alien individual for the period he is temporarily present in the United States as a nonimmigrant under subparagraph (F), (J), (M), or (Q) of section 101(a)(15) of the Immigration and Nationality Act, as amended, and which is performed to carry out the purpose specified in subparagraph (F), (J), (M), or (Q), as the case may be;
IRS Foreign Student FICA Guidance
The IRS confirms that authorized practical training is covered while the F-1 student is a nonresident alien.
Nonresident alien student under F-1, J-1 or M-1 visa status
These nonresident alien students are exempt from Social Security Tax and Medicare Tax on wages paid to them for services performed within the U.S. To qualify for the exemption, the services performed need to be allowed by USCIS for these nonimmigrant statuses, and such services are performed to carry out the purposes for which such visas were issued to them. Practical Training student employment on or off campus.
IRS Alien FICA Guidance
The F‑1 visa label alone does not preserve the exemption after the worker becomes a resident for federal tax purposes.
Limitations on exemption
The exemption does not apply to nonimmigrants in F-1, J-1, M-1, or Q-1 status who become resident aliens for tax purposes.
IRC 7701(b)(5)(E)(ii)
The Code supplies a narrow way to remain an exempt student after five calendar years.
§7701(b)(5)(E)(ii)
For any calendar year after the 5th calendar year for which an individual was an exempt individual under clause (ii) or (iii) of subparagraph (A), such individual shall not be treated as an exempt individual by reason of clause (iii) of subparagraph (A), unless such individual establishes to the satisfaction of the Secretary that such individual does not intend to permanently reside in the United States and that such individual meets the requirements of subparagraph (D)(ii).
26 CFR 301.7701(b)-3
The regulation confirms that partial calendar years count and states the conditions for the beyond‑five exception.
(b)(7)(iii)
An individual will not be able to exclude days of presence as a student if the individual has been exempt as a teacher, trainee, or student for any part of more than five calendar years, unless it is established to the satisfaction of the district director that the individual does not intend to reside permanently in the United States and has substantially complied with the requirements of the student visa providing for the individual's temporary presence in the United States.
IRS Substantial Presence Test
This is the federal formula to apply once student days are no longer excluded.
Substantial Presence Test
To meet this test, you must be physically present in the United States (U.S.) on at least: 1. 31 days during the current year, and 2. 183 days during the 3-year period that includes the current year and the 2 years immediately before that, counting: * All the days you were present in the current year, and * 1/3 of the days you were present in the first year before the current year, and * 1/6 of the days you were present in the second year before the current year.
IRS Exempt Individual—Student Guidance
A student excluding U.S.-presence days must submit Form 8843.
Form 8843
If you qualify to exclude days of presence as a student, you must file a fully-completed Form 8843, Statement for Exempt Individuals and Individuals with a Medical Condition with the IRS. If you are already filing an income tax return, attach Form 8843 to your income tax return.
SEVP OPT Directly Related Guidance
DHS requires the OPT duties to have a logical connection to the student's major.
pages 1–3
Federal regulation permits F-1 nonimmigrant students to apply for authorization to engage in Optional Practical Training (OPT) that is directly related to their major area of study. The inquiry is whether there is a logical connection between the duties involved in the practical training opportunity and the student's major area of study.
DHS STEM OPT Staffing Guidance
For STEM OPT, a placement agency cannot substitute for the actual training employer on Form I‑983.
If a student uses a temporary or staffing agency to place them in a training opportunity, the agency cannot complete and sign the Form I-983, 'Training Plan for STEM OPT Students.' Only the E-verified employer that provides the actual training relevant to the student’s qualifying STEM degree is authorized to sign and complete the Form I-983.
IRS Publication 15 (2026)
The IRS employer guide tells payroll to repay excess Social Security and Medicare withholding.
Section 13, Refunding amounts incorrectly withheld from employees
If you withheld more than the correct amount of income, social security, or Medicare tax from wages paid, repay or reimburse the employee the excess. Any excess income tax or Additional Medicare Tax withholding must be repaid or reimbursed to the employee before the end of the calendar year in which it was withheld. Keep in your records the employee’s written receipt showing the date and amount of the repayment or record of reimbursement.
IRS Publication 519 (2025)
The employee must seek repayment from payroll first and then may claim from the IRS.
page 61, Refund of Taxes Withheld in Error
If social security or Medicare tax was withheld in error from pay that is not subject to these taxes, contact the employer who withheld the taxes for a refund. If you are unable to get a full refund of the amount from your employer, file a claim for refund with the IRS on Form 843.
IRS Publication 519 (2025)
Publication 519 lists the evidence for an F‑1 OPT refund claim and gives the special Ogden address.
pages 61–62, Refund of Taxes Withheld in Error
Attach the following items to Form 843. • A copy of your Form W-2 to prove the amount of social security and Medicare taxes withheld. • A copy of your visa. • Form I-94 (or other documentation showing your date of arrival or departure). • If you have a J-1 visa, attach a copy of your Form DS-2019. • If you have an F-1 or M-1 visa, attach a complete copy of your Form I-20. • If you are engaged in optional practical training, attach Form I-766. • If you are engaged in employment due to severe economic necessity, documentation showing permission to work in the United States. • A statement from your employer indicating the amount of the reimbursement your employer provided and the amount of the credit or refund your employer claimed or you authorized your employer to claim. If you cannot obtain this statement from your employer, you must provide this information on your own statement and explain why you are not attaching a statement from your employer or on Form 8316 claiming your employer will not issue the refund. • If you were exempt from social security and Medicare taxes for only part of the year, pay statements showing the tax paid during the period you were exempt. Send Form 843 (with attachments) to: Department of the Treasury Internal Revenue Service Center Ogden, UT 84201-0038
Form 8316
Form 8316 documents the unsuccessful employer‑first attempt and accompanies Form 843.
instruction above line 1
you must first try to get a refund of the Social Security taxes from your employer before filing a claim with the Internal Revenue Service. If you did this but have not been able to get a refund from your employer, please complete the remainder of this form and attach it to your claim Form 843.
Instructions for Form 843
Each year generally needs its own Form 843, subject to the stated limitations period.
Separate Form Required
Generally, you must file a separate Form 843 for each tax period or fee year or type of tax or fee. Generally, you must file a claim for a credit or refund within 3 years from the date you filed your original return or 2 years from the date you paid the tax, whichever is later.
IRC 6511(a)
The statute supplies the two‑year rule when no return was filed.
§6511(a)
Claim for credit or refund of an overpayment of any tax imposed by this title in respect of which tax the taxpayer is required to file a return shall be filed by the taxpayer within 3 years from the time the return was filed or 2 years from the time the tax was paid, whichever of such periods expires the later, or if no return was filed by the taxpayer, within 2 years from the time the tax was paid.
2026 General Instructions for Forms W‑2 and W‑3
If payroll repays a prior‑year error, it must correct the Social Security and Medicare entries on Form W‑2c.
page 14, Repayments
If the repayment was for a prior year, you must file Form W-2c with the SSA to correct only social security and Medicare wages and taxes, and furnish a copy to the employee.
These are the official rules as published on the cited dates; tax and immigration rules can change.
This is general information about official government processes, not legal advice, and SettleKit is not a law firm.

