THAC0 (/ˈθækoʊ/, thack-oh) is an abbreviation for To Hit Armor Class Zero (0), and is used as the basis for determining if an attack roll succeeds in AD&D 2nd edition. To calculate if a hit succeeds, the player rolls a 20-sided die, and adds or subtracts any bonuses or penalties. That number is then subtracted from the character's THAC0 valid to yield the strongest armor class (AC) that the attack hits. (In AD&D, armor classes range from 10 for the worst to -10 for the best.) Conversely, a player can subtract the opponent's AC (if known) from their THAC0 value to find the roll needed to hit.
Example: If the player's character has a THAC0 of 10, and they roll a 12 on the die (with no bonuses), the best armor class they can hit is -2 (10 - 12 = -2). Conversely, if the same character wishes to hit an enemy with an AC of 4, they need to roll a 6 (10 - 4 = 6). The lower the THAC0, the lower the roll needed to hit a given AC value.
Fighter classes have the best THAC0 progression and spell users have the worst.
A rough guide to convert THAC0 and AC to 3rd edition is to subtract the number from 20. so 20 - THAC0= Base Attack Bonus (BAB), 20 - 2e AC= 3e AC.