Despite being one of the simplest structural elements, beams are used in many engineering structures. One of the most common methods to analyze and design such structures is the finite element method. Even though many different shape functions for finite beam elements have been offered, still there is a need for a beam formulation that does not suffer from numerical errors, locking problems, and yields accurate results with minimum number of elements. For this reason, in this study, a finite curved beam element formulation is developed based on the exact analytical solution of the governing differential equation of planar curved beams. The axial extension and shear deformation effects are considered in the formulation. Since the stiffness matrix and consistent load vector are obtained from the exact solution, there is no locking problem with the formulation. Many numerical examples are solved to indicate the performance of the proposed element with any loading and boundary conditions. Beams with varying curvature and varying cross section are investigated along with the circular beams with constant cross section. The results show that the element formulation is superior to other elements in the literature with accuracy and wide range of applicability for arbitrarily shaped curved beams.