We present {it Chandra} X-ray Observatory observations of Giga-Hertz Peaked Spectrum (GPS) and Compact Steep Spectrum (CSS) radio sources. The {it Chandra} sample contains 13 quasars and 3 galaxies with measured 2-10 keV X-ray luminosity within $10^{42} - 10^{46}$ erg s$^{-1}$. We detect all of the sources, five of which are observed in X-ray for the first time. We study the X-ray spectral properties of the sample. The measured absorption columns in the quasars are different than those in the galaxies in the sense that the quasars show no absorption (with limits $sim 10^{21} rm cm^{-2}$) while the galaxies have large absorption columns ($> 10^{22} rm cm^{-2}$) consistent with previous findings. The median photon index of the sources with high S/N is $Gamma=1.84 pm0.24$ and it is larger than the typical index of radio loud quasars. The arcsec resolution of {it Chandra} telescope allows us to investigate X-ray extended emission, and look for diffuse components and X-ray jets. We found X-ray jets in two quasars (PKS 1127-145, B2 0738+32), an X-ray cluster surrounding a CSS quasar (z=1.1, 3C 186), detected a possible binary structure in 0941-080 galaxy and an extended diffuse emission in galaxy PKS B2 1345+12. We discuss our results in the context of X-ray emission processes and radio source evolution. We conclude that the X-ray emission in these sources is most likely unrelated to a relativistic jet, while the sources radio-loudness may suggest a high radiative efficiency of the jet power in these sources.