The present paper is devoted to the description of local and 2-local derivations and automorphisms on Cayley algebras over an arbitrary field F. Given a Cayley algebra C with norm n, let C0 be its subspace of trace 0 elements. We prove that the space of all local derivations of C coincides with the Lie algebra {d∈so(C,n)|d(1)=0} which is isomorphic to the orthogonal Lie algebra so(C0,n). Surprisingly, the behavior of 2-local derivations depends on the Cayley algebra being split or division. Every 2-local derivation on the split Cayley algebra is a derivation, so they are isomorphic to the exceptional Lie algebra g2(F) if charF≠2,3. On the other hand, on division Cayley algebras over a field F, the sets of 2-local derivations and local derivations coincide. As a corollary we obtain descriptions of local and 2-local derivations of the seven-dimensional simple non-Lie Malcev algebras over fields of characteristic ≠2,3. Further, we prove that the group of all local automorphisms of C coincides with the group {φ∈O(C,n)|φ(1)=1}. As in the case of 2-local derivations, the behavior of 2-local automorphisms depends on the Cayley algebra being split or division. Every 2-local automorphism on the split Cayley algebra is an automorphism, so they form the exceptional Lie group G2(F) if charF≠2,3. On the other hand, on division Cayley algebras over a field F, the groups of 2-local automorphisms and local automorphisms coincide.