- Observations of γ-ray burst afterglows suggest that the correlation length of magnetic field fluctuations downstream of relativistic nonmagnetized collisionless shocks grows with distance from the shock to scales much larger than the plasma skin depth. We argue that this indicates that the plasma properties are described by a self-similar solution and derive constraints on the scaling properties of the solution. For example, we find that the scaling of the characteristic magnetic field amplitude with distance from the shock is B DsB, with -1 < sB ≤ 0; that the spectrum of accelerated particles is dn/dE E−2/(sB + 1); and that the scaling of the magnetic correlation function is Bi(x)Bj(x + Δx) Δx2sB (for Δx D). We show that the plasma may be approximated as a combination of two self-similar components: a kinetic component of energetic particles and an MHD-like component representing thermal particles. We argue that the latter may be considered as infinitely conducting, in which case sB = 0 and the scalings are completely determined (e.g., dn/dE E-2 and B D0, with possible logarithmic corrections). Similar claims apply to nonrelativistic shocks such as in supernova remnants, if the upstream magnetic field can be neglected. Self-similarity has important implications for any model of particle acceleration and/or field generation. For example, we show that the diffusion function in the angle μ of momentum p in diffusive shock acceleration models must satisfy Dμμ(p,D) = D-1μμ(p/D) (where p is the particle momentum) and that a previously suggested model for the generation of large-scale magnetic fields through a hierarchical merger of current filaments should be generalized. A numerical experiment testing our analysis is outlined.