We hypothesize that planets are made by tidal downsizing of migrating giant planet embryos. The proposed scheme for planet formation consists of these steps: (i) a massive young protoplanetary disc fragments at R similar to several tens to hundreds of au on gaseous clumps with masses of a few Jupiter masses; (ii) the clumps cool and contract, and simultaneously migrate closer in to the parent star; (iii) as earlier suggested by Boss, dust sediments inside the gas clumps to form terrestrial mass solid cores; (iv) if the solid core becomes more massive than similar to 10M(circle plus), a massive gas atmosphere collapses on to the solid core and (v) when the gas clumps reach the inner few au from the star, tidal shear and evaporation due to stellar irradiation peel off the outer metal-poor envelope of the clump. If tidal disruption occurs quickly, while the system is still in stage (iii), a terrestrial planet core is left. If it happens later, in stage (iv), a metal-rich gas giant planet with a solid core emerges from the envelope.