First-principles calculations of \ensuremath{\beta}- and spinel-sialons $({\mathrm{Si}}_{6\ensuremath{-}z}{\mathrm{Al}}_{z}{\mathrm{O}}_{z}{\mathrm{N}}_{8\ensuremath{-}z})$ have been systematically made by a plane-wave pseudopotentials method, in order to find out atomic arrangements, bondings, and electronic structures of optimized structures. Al-O and Si-N bonds are found to be clearly preferred as compared with Si-O and Al-N bonds in two kinds of crystals. In the optimized structures, the band gap can be roughly approximated as the weighed average of those for end members, i.e., ${\mathrm{Si}}_{3}{\mathrm{N}}_{4}$ and ${\mathrm{Al}}_{3}{\mathrm{O}}_{3}\mathrm{N}.$ Few impuritylike states are formed near the band edges. Averaged bond-lengths of Al-X and Si-X (X=N and O) are almost constant and independent of z for a given site of each crystal. All of these results are consistent to experimental information thus far been available by nuclear magnetic resonance and extended x-ray absorption fine structures. Calculations of formation energies of \ensuremath{\beta}-sialons using supercells composed of 56 atoms suggest ordering of solute atoms to form a unique local structure is not likely to take place.