Here is list of top indebted countries of the world.
Almost all big economic powers like USA, Japan, China are prominent in this list.
If whole world is under debt then who is the lender 
Source: VGraphs Facebook Page
Most of these loans are from their own people. Like the countries take loans from their people primarily selling bonds. Insurance companies and pension funds lend money to the govt by collecting bonds. Other countries, IMF, the world bank, and JAICA are also some sources of funds for the under develop and developing countries.