Two compressible turbulent boundary layers have been calculated by using direct numerical simulation. One case is a subsonic turbulent boundary layer with constant wall temperature for which the wall temperature is 1.58 times the freestream temperature and the other is a supersonic adiabatic turbulent boundary layer subjected to a supersonic freestream with a Mach number 1.8. The purpose of this study is to test the strong Reynolds analogy (SRA), the Van Driest transformation, and the applicability of Morkovin’s hypothesis. For the first case, the influence of the variable density effects will be addressed. For the second case, the role of the density fluctuations, the turbulent Mach number, and dilatation on the compressibility will be investigated. The results show that the Van Driest transformation and the SRA are satisfied for both of the flows. Use of local properties enable the statistical curves to collapse toward the corresponding incompressible curves. These facts reveal that both the compressibility and variable density effects satisfy the similarity laws. A study about the differences between the compressibility effects and the variable density effects associated with heat transfer is performed. In addition, the difference between the Favre average and Reynolds average is measured, and the SGS terms of the Favre-filtered Navier-Stokes equations are calculated and analyzed.