In this study, to see pressure effects on optical, thermodynamic, structural, elastic, electronic properties, charge density, and phonon frequencies of the XAl (X:Rh, Ru) compounds in B2 structure, the first-principles methods were used. The ground-state properties of these compounds were determined and compared with experimental and theoretical data. High Young’s and shear modulus showed these compounds to be hard materials. The investigated compounds have ductile property according to the Paugh criterion and Poisson’s ratio calculated from elastic constants. The electronic band structure showed that these compounds have a metallic nature. Dynamic stability using phonon distribution curves was determined under pressure. The bond properties between Rh-Al and Ru-Al atoms were evaluated in detail by Mulliken Atomic Populations and charge density analysis. Also, the optical properties are examined in detail. We think that this theoretical work contributes greatly to engineering applications due to the electronic, thermodynamic, and optical behavior of XAl (X: Rh, Ru) compounds.