To compare the diagnostic accuracy of TE and MRE and establish cutoff levels and diagnostic strategies for both techniques, enabling selection of patients for liver biopsy. One hundred three patients with chronic hepatitis B or C and liver biopsy were prospectively included. Areas under curves (AUROC) were compared for TE and MRE for METAVIR fibrosis grade ≥ F2 and ≥F3. We defined cutoff values for selection of patients with F0–F1 (sensitivity >95 %) and for significant fibrosis F2–F4 (specificity >95 %). Following exclusions, 85 patients were analysed (65 CHB, 19 CHC, 1 co-infected). Fibrosis stages were F0 (n = 3), F1 (n = 53), F2 (n = 15), F3 (n = 8) and F4 (n = 6). TE and MRE accuracy were comparable [AUROCTE ≥ F2: 0.914 (95 % CI: 0.857–0.972) vs. AUROCMRE ≥ F2: 0.909 (0.840–0.977), P = 0.89; AUROCTE ≥ F3: 0.895 (0.816–0.974) vs. AUROCMRE ≥ F3: 0.928 (0.874–0.982), P = 0.42]. Cutoff values of <5.2 and ≥8.9 kPa (TE) and <1.66 and ≥2.18 kPa (MRE) diagnosed 64 % and 66 % of patients correctly as F0–F1 or F2–F4. A conditional strategy in inconclusive test results increased diagnostic yield to 80 %. TE and MRE have comparable accuracy for detecting significant fibrosis, which was reliably detected or excluded in two-thirds of patients. A conditional strategy further increased diagnostic yield to 80 %. • Both ultrasound-based transient elastography and magnetic resonance elastography can assess hepatic fibrosis. • Both have comparable accuracy for detecting liver fibrosis in viral hepatitis. • The individual techniques reliably detect or exclude significant liver fibrosis in 66 %. • A conditional strategy for inconclusive findings increases the number of correct diagnoses.