Efficient synthetic routes are continuously pursued for graphene in order to implement its applications in different areas. However, direct conversion of simple monomers to graphene through polymerization in a scalable manner remains a major challenge for chemists. Herein, a molten-salt (MS) route for the synthesis of carbon nanostructures and graphene by controlled carbonization of glucose in molten metal chloride is reported. In this process, carbohydrate undergoes polymerization in the presence of strongly interacting ionic species, which leads to nanoporous carbon with amorphous nature and adjustable pore size. At a low precursor concentration, the process converts the sugar molecules (glucose) to rather pure few-layer graphenes. The MS-derived graphenes are strongly hydrophobic and exhibit remarkable selectivity and capacity for absorption of organics. The methodology described may open up a new avenue towards the synthesis and manipulation of carbon materials in liquid media.