We initiate the theory of a quadratic form q over a semiring R, with a view to study tropical linear algebra. As customary, one can writeq(x+y)=q(x)+q(y)+b(x,y), where b is a companion bilinear form. In contrast to the classical theory of quadratic forms over a field, the companion bilinear form need not be uniquely defined. Nevertheless, q can always be written as a sum of quadratic forms q=qQL+ρ, where qQL is quasilinear in the sense that qQL(x+y)=qQL(x)+qQL(y), and ρ is rigid in the sense that it has a unique companion. In case that R is supertropical, we obtain an explicit classification of these decompositions q=qQL+ρ and of all companions b of q, and see how this relates to the tropicalization procedure.