Computing the fractal dimension (FD) can be a very time-consuming process. Nowadays, the data precision or resolution of many sensors is increasingly high (magnetic resonance, ultrasounds, microcomputed tomography, etc.) and, furthermore, some applications require 3D data post-processing. The processing of large data sets is also very common in several analyses and applications. Therefore, fast algorithms for computing the FD are required, above all for interactive applications. Graphics processing unit (GPU) programming has become a standard tool for optimizing certain sorts of time-consuming algorithms. If the problem fits the GPU programming model well, high speedups can be achieved. CUDA and OpenCL are two of the most popular GPU technologies since they do not require special knowledge of computer graphics programming. In this chapter, we present our experience optimizing the processing time of the classic box-counting algorithm to compute the FD by means of CUDA and OpenCL GPU programming. Speedups of up to 28x (CUDA) and 6.3x (OpenCL) against the single-thread CPU version of the algorithm have been obtained. CUDA results are better because the box-counting algorithm has a strong dependency on sorting, and the OpenCL implementations of the best sorting algorithms are not as efficient as the CUDA ones.