There are many definitions of the fractal dimension of an object, including box dimension, Bouligand-Minkowski dimension, and intersection dimension. Although they are all equivalent in the continuous domain, they differ substantially when discretized and applied to digitized data. We show that the standard implementations of these definitions on self-affine curves with known fractal dimension (Weierstrass-Mandelbrot, Kiesswetter, fractional Brownian motion) yield results with significant errors. An analysis of the source of these errors leads to a new algorithm in one dimension, called the variation method, which yields accurate results. The variation method uses the notion of ɛ oscillation to measure the amplitude of the one-dimensional function in an ɛ neighborhood. The order of growth of the integral of the ɛ oscillation (called the ɛ variation), as ɛ tends toward zero, is directly related to the fractal dimension. In this paper, we present the variation method for one-dimensional (1D) profiles and show that, in the limit, it is equivalent to the classical box-counting method. The result is an algorithm for reliably estimating the fractal dimension of 1D profiles; i.e., graphs of functions of a single variable. The algorithm is tested on profiles with known fractal dimension.