A not necessarily continuous, linear or multiplicative function from an algebra A into itself is called a local automorphism if agrees with an automorphism of A at each point in A. In this paper, we study the question when a local automorphism of a C*-algebra, or a W*-algebra, is an automorphism.