KEK has been investigating the better conditions of the heat treatment in nitrogen, which are called as nitrogen doping and nitrogen infusion. We have tried to understand the high gradient performance of the cavity from the anal-yses of samples which were prepared in the same conditions for the cavity. The main tools are D-SIMS for the depth profile of the elemental concentration, XPS for composition analysis and SQUID magnetometry for the critical DC magnetic field measurement. The difference in the depth profiles of the nitrogen, car-bon and oxygen between the heat treatment conditions, containing the degree of vacuum and furnace temperature of nitrogen injection, was observed by GD-OES, D-SIMS and XPS. Such a difference correlates with the vortex penetration field measured by SQUID. In particular, that of the nitrogen doping sample was greatly degraded, while that of the nitrogen infusion sample was slightly improved. The tendency is consistent with the RF high gradient test results.