The lyrics were written by John Newton in 1772 (years after his conversion and abandonment of the slave trade and becoming an Anglican minister).
The current tune “New Britain” was not applied to it until 1835. It is listed as an anonymous American folk song (some say it was a Scottish folk tune prior to that). This tune was first recorded in a tune book in 1829 for worship and revivals.
The harmony and final arrangement we use today was done by Edwin Excell (a Christian composer of the late 19th/early 20th century with a long resume of Christian hymns).
* John Newton. http://www.hymnary.org/person/Newton_John
* Tune “New Britain.” http://www.hymnary.org/tune/new_britain
* Edwin Excell. http://www.hymnary.org/person/Excell_Edwin
* Pages from Excell’s hymnbook to feature Amazing Grace. https://loc.gov/item/ihas.200038826