Context. The bright low-mass X-ray binary (LMXB) GX 13+1 is one of the most peculiar Galactic binary systems. A periodicity of 24.27 d was observed in its power spectrum density obtained from data collected over 14 years by the All Sky Monitor (ASM) on board the Rossi X-ray Timing Explorer (RXTE). Aims. To determine the first X-ray orbital ephemeris of GX 13+1, we systematically searched for periodic dips in the RXTE/ASM and Monitor of All-sky X-ray Image (MAXI) light curves of the source, the light curves span from 1996 up to 2013. Methods. We searched for a periodic signal in the RXTE/ASM and MAXI light curves and find a common periodicity of 24.53 d. We folded the 1.3-5 keV and 5-12.1 keV RXTE/ASM light curves and the 2-4 and 4-10 keV MAXI light curves with the period of 24.53 d and detected a periodic dip. To refine the value of the period we divided the RXTE/ASM and MAXI light curves into eight and two intervals, respectively. Using the timing technique, we obtained four and two dip arrival times from the RXTE/ASM and MAXI light curves, respectively. Results. We improved the X-ray position of GX 13+1 using a recent Chandra observation. The new X-ray position is discrepant by ∼7 from the previous one, while it is compatible with the infrared and radio counterpart positions. We detected an X-ray dip totally covered by the Chandra observation and showed, a posteriori, that it is a periodic dip. We obtained seven dip arrival times from RXTE/ASM, MAXI, and Chandra light curves. We calculated the delays of the detected dip arrival times with respect to the expected times for a 24.52 d periodicity. Fitting the delays with a linear function, we find that the orbital period and the epoch of reference of GX 13+1 are 24.5274(2) days and 50 086.79(3) MJD, respectively. We do not improve the fit by adopting a quadratic ephemeris. The inferred orbital period derivative of 8(37) × 10 −8 s/s, with an error of 68% confidence level, does not allow us to constrain the orbital evolution of the binary system. Conclusions. We demonstrated the existence of periodic dips in both RXTE/ASM and MAXI light curves, and estimated that the orbital period of GX 13+1 is 24.5274(2) d. The LMXB GX 13+1 has the longest known orbital period for a Galactic neutron star LMXB powered by Roche lobe overflow.