The effect of thermal annealing on structure and mechanical properties of amorphous SiCxNy (y ≥ 0) thin films was investigated up to 1500°C in air and Ar. The SiCxNy films (2.2–3.4 μm) were deposited by reactive DC magnetron sputtering on Si, Al2O3 and α‐SiC substrates without intentional heating and at 600°C. The SiC target with small excess of carbon was sputtered at various N2/Ar gas flow ratios (0–0.48). The nitrogen content in the films changes in the range 0–43 at.%. Hardness and elastic modulus (nanoindentation), change in film thickness, film composition, and structure (Raman spectroscopy, XRD) were investigated in dependence on annealing temperature and nitrogen content. All SiCxNy films preserve their amorphous structure up to 1500°C. The hardness of all as‐deposited and both air‐ and Ar‐annealed SiCxNy films decreases with growth of nitrogen content. The annealing in Ar at temperatures of 1100°C–1300°C results in noticeable hardness growth despite the ordering of graphite‐like structure in carbon clusters in nitrogen free films. Unlike the SiC, this graphitization leads to hardness saturation of SiCN films starting above 900°C, especially for films with higher nitrogen content (deposited at higher N2/Ar). This indicates the practical hardness limit achievable by thermal treatment for SiCxNy films deposited on unheated substrates. The ordering in carbon phase is facilitated by the presence of nitrogen in the films and its extent is controlled by the N/C atomic ratio. The suppression of graphitization was observed for N/C ranging between 0.5–0.7. Films deposited at 600°C show higher hardness and oxidation resistance after annealing in comparison with those deposited on unheated substrates. Hardness reaches 40 GPa for SiC and ~28 GPa for SiCxNy (35 at.% of nitrogen). Such a high hardness of SiC film stems from its partial crystallization. Annealing of SiCxNy film (35 at.% of N) in Ar at 1400°C is accompanied by formation of numerous hillocks (indicating heterogeneous structure of amorphous films) and redistribution of film material.