Let R be an associative ring with identity 1. We describe all idempotent matrices with only zeros and ones on the diagonal in T (n, R) - the ring of n x n upper triangular matrices over R (n epsilon N), and - T (infinity, R) - the ring of infinite upper triangular matrices (indexed by ) over R. Moreover, when R is finite, we calculate the number of all idempotent matrices with only zeros and ones on the diagonal in T(n, R).