Two-dimensional (2D) materials have attracted significant interest because of their large surface-to-volume ratios and electron confinement. Compared to common 2D materials such as graphene or metal hydroxides, with their intrinsic layered atomic structures, the formation mechanisms of 2D metal oxides with a rocksalt structure are not well understood. Here, we report the formation process for 2D cobalt oxide and cobalt nickel oxide nanosheets, after analysis by in situ liquid-phase transmission electron microscopy. Our observations reveal that three-dimensional (3D) nanoparticles are initially formed from the molecular precursor solution and then transform into 2D nanosheets. Ab initio calculations show that a small nanocrystal is dominated by positive edge energy, but when it grows to a certain size, the negative surface energy becomes dominant, driving the transformation of the 3D nanocrystal into a 2D structure. Uncovering these growth pathways, including the 3D-to-2D transition, provides opportunities for future material design and synthesis in solution.