The formula is Your New Rating = Your Rating at End of Game + K(Result) - K/{10^[(Opponent's Rating at End of Game - Your Rating at End of Game)/400]+1}.

Note: Result is 1 if you win, 0.5 if you draw and 0 if you lose.

Note: K is 32 if your rating is between 0 and 2099 (inclusive), 24 if your rating is between 2100 and 2399 (inclusive), and 16 if your rating is 2400 and above.

Note: If your opponent has played less than 20 games (i.e. between 0 and 19 games (inclusive)), then K is 16 if your rating is between 0 and 2099 (inclusive), 12 if your rating is between 2100 and 2399 (inclusive), and 8 if your rating is 2400 and above.

Note: If your opponent has played less than 5 games (i.e. between 0 and 4 games (inclusive)), then Opponent's Rating at End of Game is treated as 1200 for the purpose of this formula.