Let A 1 , . . . , As be unitary commutative rings which do not have non-trivial idempotents and let A = A 1 ⊕ • • • ⊕ As be their direct sum. We describe all idempotents in the 2 × 2 matrix ring M 2 (A[[X]]) over the ring A[[X]] of formal power series with coefficients in A and in arbitrary set of variables X. We apply this result to the matrix ring M 2 (Zn[[X]]) over the ring Zn[[X]] for an arbitrary positive integer n greater than 1. Our proof is elementary and uses only the Cayley-Hamilton theorem (for 2 × 2 matrices only) and, in the special case A = Zn, the Chinese reminder theorem and the Euler-Fermat theorem.