In this paper we devise a rational curve fitting algorithm and apply it to the list decoding of Reed-Solomon and BCH codes. The resulting list decoding algorithms exhibit the following significant properties.• The algorithm achieves the limit of list error correction capability (LECC) n(1 − √ 1 − D)for a (generalized) (n, k, d = n − k + 1) Reed-Solomon code, which matches the Johnson bound, where D △ = d n denotes the normalized minimum distance. The algorithmic complexity is O n 6 (1 − √ 1 − D) 8 . In comparison with the Guruswami-Sudan algorithm, which exhibits the same LECC, the proposed requires a multiplicity (which dictates the algorithmic complexity) significantly smaller than that of the Guruswami-Sudan algorithm in achieving a given LECC, except for codes with code-rate below 0.15. In particular, for medium-to-high rate codes, the proposed algorithm reduces the multiplicity by orders of magnitude. Moreover, for any ǫ > 0, the intermediate LECC t = ⌊ǫ · d 2 + (1 − ǫ) · (n − n(n − d))⌋ can be achieved by the proposed algorithm with multiplicity m = ⌊ 1 ǫ ⌋. Its list size is shown to be upper bounded by a constant with respect to a fixed normalized minimum distance D, rendering the algorithmic complexity quadratic in nature, O(n 2 ).• By utilizing the unique properties of the Berlekamp algorithm, the algorithm achieves the LECC limit n 2 (1 − √ 1 − 2D) for a narrow-sense (n, k, d) binary BCH code, which matches the Johnson bound for binary codes. The algorithmic complexity is O n 6 (1 − √ 1 − 2D) 8 . Moreover, for any ǫ > 0, the intermediate LECC t = ⌊ǫ · d 2 + (1 − ǫ) · n− √ n(n−2d) 2 ⌋ can be achieved by the proposed algorithm with multiplicity m = ⌊ 1 2ǫ ⌋. Its list size is shown to be upper bounded by a constant, rendering the algorithmic complexity quadratic in nature, O(n 2 ).