Context. Compact circumstellar envelopes (CSEs) have been detected around several Cepheids by interferometry. In particular, observations with the VINCI instrument revealed in 2006 a compact envelope around the long period Cepheid Car (P = 35.5 days). Another Cepheid, RS Pup (P = 41.4 days), presents a large (≈2 ) circumstellar nebula scattering the Cepheid light in the visible. These envelopes are particularly interesting for two reasons: their presence could impact the Cepheid distance scale, and they could imply stellar mass loss. Aims. Our goal is to establish the spatial and spectral properties of the CSEs of Car and RS Pup. This is done through a parametrization of the envelopes in terms of fractional flux (with respect to the star) and angular size. Methods. We retrieved archival Spitzer images of the two stars (λ = 3.5−70 μm), and obtained new diffraction-limited imaging with the VLT/VISIR camera in BURST mode (λ = 8.6−11.9 μm), as well as interferometric observations with the VLTI/MIDI beam combiner (λ = 8−13 μm). This combination of single-telescope and interferometric techniques allows us to probe the envelopes of the two Cepheids over a broad range of angular scales, from arcminutes to milliarcseconds. Results. The circumstellar envelope of RS Pup is resolved spatially at 24 and 70 μm by Spitzer, and around 10 μm by MIDI and VISIR. The envelope of Car appears much more compact, and is resolved only in the VISIR and MIDI observations. The infrared excesses we detect around RS Pup and Car are both very significant, but differ considerably in spectral and spatial properties. We detect a warm component in the CSE of both stars at a spatial scale of a few 100 to a few 1000 AU. In addition, RS Pup presents a very large (several 100 000 AU) and cold (≈40 K) dusty envelope. Conclusions. The observed properties of the CSEs lead us to propose that the cold dust content of the large reflection nebula surrounding RS Pup has an interstellar origin, while the warm CSEs of the two stars were created by ongoing stellar mass loss. We also speculate that the NGC 7023 reflection nebula surrounding the Herbig Be star HD 200775 is an analogue of RS Pup at an age of 100 000 years. The presence of CSEs around the two brightest long-period Cepheids is an indication that many long-period members of this class, if not all, could be surrounded by warm circumstellar envelopes created by mass loss. However, very large dusty envelopes such as that of RS Pup are probably less common, as according to our scenario, they require the presence of a high dust density in the interstellar medium (ISM) at the time of the formation of the Cepheid progenitor.