Carbonaceous (C-type) asteroids1 are relics of the early Solar System that have preserved primitive materials since their formation approximately 4.6 billion years ago. They are probably analogues of carbonaceous chondrites2,3 and are essential for understanding planetary formation processes. However, their physical properties remain poorly known because carbonaceous chondrite meteoroids tend not to survive entry to Earth’s atmosphere. Here we report on global one-rotation thermographic images of the C-type asteroid 162173 Ryugu, taken by the thermal infrared imager (TIR)4 onboard the spacecraft Hayabusa25, indicating that the asteroid’s boulders and their surroundings have similar temperatures, with a derived thermal inertia of about 300 J m−2 s−0.5 K−1 (300 tiu). Contrary to predictions that the surface consists of regolith and dense boulders, this low thermal inertia suggests that the boulders are more porous than typical carbonaceous chondrites6 and that their surroundings are covered with porous fragments more than 10 centimetres in diameter. Close-up thermal images confirm the presence of such porous fragments and the flat diurnal temperature profiles suggest a strong surface roughness effect7,8. We also observed in the close-up thermal images boulders that are colder during the day, with thermal inertia exceeding 600 tiu, corresponding to dense boulders similar to typical carbonaceous chondrites6. These results constrain the formation history of Ryugu: the asteroid must be a rubble pile formed from impact fragments of a parent body with microporosity9 of approximately 30 to 50 per cent that experienced a low degree of consolidation. The dense boulders might have originated from the consolidated innermost region or they may have an exogenic origin. This high-porosity asteroid may link cosmic fluffy dust to dense celestial bodies10.