Disclaimer: I am not a tax consultant and this is completely my own take on the matter.Filing for tax in OPT can be tricky because of the sheer number of rules and conditions that apply when you are an 'alien' and also 'student'. I will try to cover the basics.The first thing that you want to check is your tax residency. Now tax residency is completely differet from your immigration status in US as considered by USCIS and other federal institutions. Here is the link for webpage from IRS that has all the rules to determine your tax residency.Determining Alien Tax StatusThe Substantial Presence Test part has been explained very well by Xuan, so do read it.Now if you are on OPT then generally you would fall under these three categories:1. You are on OPT as of 31st December or last date of your stay in USA. In this case you will be a non-resident alien for tax purpose. The form you should be looking for 1040NR or 1040 NR EZ, the first one is for itemized deductions and the 2nd one for standard deduction. Now if you happen to be from India, you are still able to claim standard deduction (for single person born after 1st January 1950, it is $6200) because India has a Tax Treaty with USA (US India Income Tax Treaty - Article 21) that allows students to claim standard deduction. This needs to be mentioned in Point 11 of 1040 NR-EZ form. As mentioned by Xuan here, the easiest way to file is to use Glacier Tax Preparation software. Here is the link for Glacier. Glacier automatically does Form 8843 for you. Many schools offer this software for free to their students, so do check out your international office or registrar's office. GLACIER Tax Prep - Home2. You are on OPT but you have been student for more than five years in USA.You have established tax residency so you can use form 1040 (itemized) or 1040 EZ (standard) to file your tax return. You can also use popular software such as TurboTax and H&R Block. There are many discounts available for TurboTax and H&R blocks such as Discover Card and State Farm members; so do explore.3. You were on OPT till 30th September and you are on H1b from 1st October. This one is crazy, so hang tight. Glacier will consider you as a non-resident alien and do a 1040 NR-EZ. I went through the form 519 of IRS (Page on irs.gov ) and as I understood, you also need to complete form 8843 along with 1040 NR-EZ. However you can not claim the tax treaty benefit anymore because you were on H1b visa on the last day of your stay in USA. You can still claim an amount of $3950 as an individual exemption. (Point 13 of 1040 NR-EZ). You are probably better off with doing an itemized deduction in this scenario which may be well above $3950, with form 1040NR. Even though your question is how to do it by yourself, I would advice you to seek a reputed tax consultant if you fall in the third category and go with Itemized Deductions with form 1040NR. If you want to do it yourself, the schedule of items that can be deducted is different from what a Resident Alien can, so read the instructions:http://www.Internal Revenue Service/pub/irs-pdf/i1040nr.pdfWhen you are talking to your consultant make sure that he/she understands filing for non-residents well. If someone is claiming he/she can get you way above what others are telling, I would stay away from them. You may have to file FBAR also. Read the instructions here: Report of Foreign Bank and Financial Accounts (FBAR).Finally, I would say chances that your IT return will be audited by IRS is fairly low, but an my advice is avoid incorrect filing. The larger the sum of your return, the higher is your risk of being audited. Best of luck! :)Edit: I put this together long back, and tax rules have changed. Please refer to the current tax laws for filing your return. Thanks!