Introduction: Right ventricular (RV) function in the setting of pulmonary hypertension based on different etiologies has not been well studied. In this study, we evaluated the RV function in patients with idiopathic pulmonary hypertension (IPH) versus secondary pulmonary hypertension (SPH) due to congestive heart failure. Material and method: Forty-five patients with pulmonary hypertension and New York Heart Association (NYHA) functional class II or III were enrolled. Of these, 22 were diagnosed with IPH and 23 with SPH. Echocardiographic data, including Doppler and Doppler based strain, were assessed according to the American Society of Echocardiography (ASE) guidelines for detailed evaluation of RV function in these two groups. Results: Mean PAP was 60 ± 14.5 mm Hg in patients with IPH versus 43 ± 11.5 mm Hg in patients with SPH (p = 0.001). Considering conventional indexes of RV function, only Sm and dp/dt were significantly better in the first group compared with the second group (p-value for Sm = 0.042 and for dp/dt = 0.039). RV end diastolic dimension was significantly higher in the IPH group (p = 0.013). Using deformation indexes of RV function, the basal and mid portion of RV free wall strain and basal RV strain rates were significantly worse in the chronic systolic heart failure (PH-HF) group in comparison to the IPH group (p < 0.001 in basal RV strain, p = 0.034 in mid RV strain and p = 0.046 in basal RV strain rate respectively). Conclusion: IPH has less impact on RV function in comparison to PH-HF. Considering both entities are in the category of RV pressure overload, we conclude that the etiology of pulmonary hypertension also plays an important role in RV function in addition to pressure overload.