Making up zakaah from past years
Question

I would like to know what I should do about Zakat. I have failed to pay in previous years out of a failure to follow the straight path of Islam. I have in the past year returned to Islam (Al-hamdulilah) and I am earning money and I would like to pay my Zakat and try to correct past sins if possible. However, I have some loans I took in the past and I have this debt. How do I pay the Zakat for the years that I missed and will it be accepted considering that missing the Zakat in previous years was haram and I am paying money on loans that are haram?
Praise be to Allah.We praise Allaah for having guided you, and we ask Allaah to make you steadfast and know that Allaah is Forgiving and Most Merciful. He rejoices over the repentance of His slave, even though He has no need of His creation. We ask Allaah to bestow more of His bounty upon you. 
You have to pay the zakaah of the past years according to the amounts of money that you possessed after paying off the debts of each year. Once you arecertain about the amount in any year, then you have to pay zakaah on it. If you do not know the exact amounts, then guess and pay based on that estimate. 
Shaykh Ibn ‘Uthaymeen (may Allaah have mercy on him) was asked: 
A man was careless about paying zakaah for five years, and now he is repenting. Does repentance free him of the obligation to pay zakaah? If it does not free him of that obligation, then what is the solution? This wealth is more than ten thousand and he does not know how much it is now. 
He replied: 
Zakaah is an act of worship towards Allaah and it is the right of the poor. If a person withholds it, then he is violating two rights: the right of Allaah and the right of the poor and others who are entitled to zakaah. If he repents after five years – as stated in the question – then he is absolved of the obligation to fulfil the right of Allaah, because Allaah says (interpretation of the meaning): 
“And He it is Who accepts repentance from His slaves, and forgives sins”
[al-Shoora 42:25]
But the second right still remains, which is the right of those who are entitled to zakaah, the poor and others. So he has to hand over the zakaah to these people, and perhaps he will attain the reward for zakaah if his repentance is sound, for the bounty of Allaah is immense. 
With regard to working out the amount of zakaah, he should estimate the amount of zakaah as best he can, and Allaah does not burden any soul beyond its scope. So if it is ten thousand, for example, how much is the zakaah for one year? Two hundred and fifty. If the amount of zakaah is two hundred and fifty, then he should pay two hundred and fifty for each of the past years, unless in some of those years he had more than ten thousand, in which case he should pay extra. If it was less in some years, then he should pay less zakaah, accordingly.
As’ilat al-Baab al-Maftooh, Q494, session 12
 And Allaah knows best.