I've been wondering about this for a while. How many distinct legal moves can be written in algebraic notation?

For the purposes of this thought experiment, en passant captures and double checks won't be given any special notation (I've seen that done occasionally) but captures, checks, and checkmates will. So, for example, Ra1, Ra1+, Rxa1, Rxa1+, and Rxa1# would all be considered distinct moves.

I've tried to work this out before but the part that always gets me tripped up is when you get to the moves where you have to designate which piece is moving (Rad1, N2g4, etc.). Since we're trying to cover all possible legal moves, this would also include moves where multiple queens or bishops have to be specified (Q2e5, Bbd3, etc.)

I think there are at least thousands but I wonder if anyone has a formula to help calculate this.

For the purposes of this thought experiment, en passant captures and double checks won't be given any special notation (I've seen that done occasionally) but captures, checks, and checkmates will. So, for example, Ra1, Ra1+, Rxa1, Rxa1+, and Rxa1# would all be considered distinct moves.

I've tried to work this out before but the part that always gets me tripped up is when you get to the moves where you have to designate which piece is moving (Rad1, N2g4, etc.). Since we're trying to cover all possible legal moves, this would also include moves where multiple queens or bishops have to be specified (Q2e5, Bbd3, etc.)

I think there are at least thousands but I wonder if anyone has a formula to help calculate this.