Answered July 2026

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.

Nonresident with valid OPTexempt

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.

Past five years but still nonresidentnarrow case

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.

Resident alien for that yearFICA due

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 explanation

Watch out for

Five calendar years—not 60 monthsAny part of a calendar year can count, and earlier F, J, M, or Q years as a student, teacher, or trainee may count too. After the fifth counted year, do not assume either result: apply the , or use the narrow beyond-five student exception only if you can establish no intent to live here permanently and substantial compliance with your status (26 CFR 301.7701(b)-3(b)(7)(iii); IRC 7701(b)(5)(E)(ii)).
An exempt individual is not tax-freeFor residency testing, means that qualifying days are left out of the ; it does not exempt all income. The payroll exemption separately comes from IRC 3121(b)(19) and requires you to remain a .
Your OPT work must qualifyThe IRS exemption applies only to USCIS-authorized work carried out for the purpose of F-1 status, and DHS requires OPT to be directly related to your major. Keep your I-20, , and a clear description connecting your duties to your degree (IRC 3121(b)(19); ICE OPT Directly Related Guidance, pages 1–3).
STEM staffing has an extra ruleThis applies only if you are on the STEM extension: a staffing agency may help place you, but the E-Verify employer actually providing the training—not a mere placement agency—must complete and sign I-983; a new I-983 is needed for each new training opportunity. If yours is ordinary 12-month OPT, the I-983 rule does not apply (DHS Study in the States, July 7, 2016).
Ask the employer firstThe IRS requires you to try the employer before filing your own claim. Do not authorize the employer to recover the employee share and also claim the same amount yourself; asks about repayment, authorization, and any employer claim (Form 8316, lines 1, 3, and 5).
The refund deadline can expireGenerally, file each by the later of three years after filing the original return or two years after paying the tax. If no return was filed for the tax, IRC 6511(a) provides a two-year-from-payment period; your missing payroll years prevent calculation of a specific last date.
Do not use the wrong refund routeThe income-tax-return credit is for excess Social Security tax caused by multiple employers exceeding the annual wage base. Erroneous Social Security and Medicare withholding by one employer follows the employer-first, then route (Publication 519, pages 60–62).
A staffing firm is not a schoolIf you are already a resident alien, the separate student-employee exemption in IRC 3121(b)(10) applies only when the employer is the school, college, or university where you study at least half-time. A staffing firm shown as the employer on your W-2 does not fit that separate exception.

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

Your I-94 travel history and first U.S. entry date
Every calendar year in F, J, M, or Q status as a student, teacher, or trainee
Prior Forms 8843 and federal returns

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

Unexpired employment authorization document
Complete Form I-20 with OPT recommendation
Short written explanation connecting your duties to your degree
If STEM OPT: Form I-983 signed by the E-Verify employer actually providing the training

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

Copies of visa, I-94, complete I-20, and
Your residency calculation and applicable Form 8843
Pay statements and any affected Forms W-2
IRC 3121(b)(19) and the IRS Foreign Student FICA Guidance URL

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

Signed for that tax period
Signed
Copy of Form W-2
Copy of visa and Form I-94
Complete copy of Form I-20
Copy of for OPT
Employer statement, or your own explanation and proof of the unsuccessful request
Pay statements if exempt for only part of the year

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.

IRC 3121(b)(19)

§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;

Read the full text

IRS Foreign Student FICA Guidance

The IRS confirms that authorized practical training is covered while the F-1 student is a nonresident alien.

IRS Foreign Student FICA Guidance

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.

Read the full text

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.

IRS Alien FICA Guidance

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.

Read the full text

IRC 7701(b)(5)(E)(ii)

The Code supplies a narrow way to remain an exempt student after five calendar years.

IRC 7701(b)(5)(E)(ii)

§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).

Read the full text

26 CFR 301.7701(b)-3

The regulation confirms that partial calendar years count and states the conditions for the beyond‑five exception.

26 CFR 301.7701(b)-3

(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.

Read the full text

IRS Substantial Presence Test

This is the federal formula to apply once student days are no longer excluded.

IRS Substantial Presence Test

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.

Read the full text

IRS Exempt Individual—Student Guidance

A student excluding U.S.-presence days must submit Form 8843.

IRS Exempt Individual—Student Guidance

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.

Read the full text

SEVP OPT Directly Related Guidance

DHS requires the OPT duties to have a logical connection to the student's major.

SEVP OPT Directly Related Guidance

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.

Read the full text

DHS STEM OPT Staffing Guidance

For STEM OPT, a placement agency cannot substitute for the actual training employer on Form I‑983.

DHS STEM OPT Staffing Guidance

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.

Read the full text

IRS Publication 15 (2026)

The IRS employer guide tells payroll to repay excess Social Security and Medicare withholding.

IRS Publication 15 (2026)

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.

Read the full text

IRS Publication 519 (2025)

The employee must seek repayment from payroll first and then may claim from the IRS.

IRS Publication 519 (2025)

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.

Read the full text

IRS Publication 519 (2025)

Publication 519 lists the evidence for an F‑1 OPT refund claim and gives the special Ogden address.

IRS Publication 519 (2025)

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

Read the full text

Form 8316

Form 8316 documents the unsuccessful employer‑first attempt and accompanies Form 843.

Form 8316

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.

Read the full text

Instructions for Form 843

Each year generally needs its own Form 843, subject to the stated limitations period.

Instructions for Form 843

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.

Read the full text

IRC 6511(a)

The statute supplies the two‑year rule when no return was filed.

IRC 6511(a)

§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.

Read the full text

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.

2026 General Instructions for Forms W‑2 and W‑3

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.

Read the full text

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.

Join the SettleKit newsletter

We research the hard parts of settling in the US and write articles you will not find anywhere else. Subscribe to get each new article by email.

One email per new article. Unsubscribe anytime.

This is likely not your only questionCheck out SettleKit, the best source on the internet for newcomers to the US.
Build your free SettleKit