Semiconductor heterostructures are fundamental building blocks for many important device applications. The emergence of two-dimensional semiconductors opens up a new realm for creating heterostructures. As the bandgaps of transition metal dichalcogenides thin films have sensitive layer dependence, it is natural to create lateral heterojunctions (HJs) using the same materials with different thicknesses. Here we show the real space image of electronic structures across the bilayer–monolayer interface in MoSe2 and WSe2, using scanning tunnelling microscopy and spectroscopy. Most bilayer–monolayer HJs are found to have a zig-zag-orientated interface, and the band alignment of such atomically sharp HJs is of type-I with a well-defined interface mode that acts as a narrower-gap quantum wire. The ability to utilize such commonly existing thickness terraces as lateral HJs is a crucial addition to the tool set for device applications based on atomically thin transition metal dichalcogenides, with the advantage of easy and flexible implementation.