In the thin airfoil theory, the camber line and the thickness distribution of general airfoils are mainly extracted by a linear combination of the upper and lower surfaces, giving rise to geometric distortions at the leading edge. Furthermore, despite the recent effort to obtain analytic expressions for the zero-lift angle of attack and quarter-chord moment coefficient, more analytic generalization is needed for the camber line component in the trigonometric series coefficients. This paper presents a straightforward algorithm to extract the camber line and thickness distribution of general airfoil shapes based on a finite differences method and the Bézier curve fitting. Integrals in the thin airfoil theory involving a Bernstein basis are performed, leading to series coefficients involving Gegenbauer polynomials. The algorithm is validated against analytical expressions of the NACA airfoils without introducing or adapting geometric parameters, and the results demonstrate good accuracy. In addition, the present work indicated a significantly different geometric behavior for the SD7003 airfoil camber slope at the leading edge obtained by the proposed algorithm and the classical linear approximation. Moreover, the method can be coupled conveniently in recent reduced-order models established on the thin airfoil theory to obtain expressions in closed forms for general airfoils.