Diagnosis of the depth of the cancer invasion is necessary to select the indication of endoscopic treatment. We used endoscopic ultrasonography (EUS) and Submucosograhy (SMG) to diagnose the depth of cancer invasion and compared their efficacy against 63 lesions in 60 cases of gastric and esophageal cancers. SMG could diagnose the invasion correctly in 97% of m (mucosa) cancers, 88% of sm (submucosa) cancers and 100% of advanced cancers. On the other hand, linear-type EUS could diagnose the cancer invasion correctly in 60% of the m cancers, 83% of the sm cancers and 100% of the advanced cancers. The results of the comparison of radial-type EUS and SMG showed similar results. Both EUS and SMG are appropriate for the judgement of endoscopic treatments.