  We prove a trace formula in stable motivic homotopy theory over a general
base scheme, equating the trace of an endomorphism of a smooth proper scheme
with the "Euler characteristic integral" of a certain cohomotopy class over its
scheme of fixed points. When the base is a field and the fixed points are
\'etale, we compute this integral in terms of Morel's identification of the
ring of endomorphisms of the motivic sphere spectrum with the Grothendieck-Witt
ring. In particular, we show that the Euler characteristic of an \'etale
algebra corresponds to the class of its trace form in the Grothendieck-Witt
ring.
