Cyclohexane and cyclooctane are both hydrocarbons that contain only carbon and hydrogen atoms arranged in a ring structure, but they differ in the number of atoms in the ring. Cyclohexane is a cycloalkane with six carbon atoms in the ring, while cyclooctane contains eight carbon atoms. Both are commonly used as solvents and in the production of various chemicals.