A semiconductor device using a TFT structure with high reliability is realized. As an insulating film used for the TFT, for example, a gate insulating film, a protecting film, an under film, an interlayer insulating film, or the like, a silicon nitride oxide film (SiNXBYOz) containing boron is formed by a sputtering method. As a result, the internal stress of this film becomes −5×1010 dyn / cm2 to 5×1010 dyn / cm2, preferably −1010 dyn / cm2 to 1010 dyn / cm2, and the film has high thermal conductivity, so that it typically becomes possible to prevent deterioration due to heat generated at the time of an on operation of the TFT.