Yes and no. Its complicated.
Its a sin not to do it. It’s obligatory between you and God. No one can force you, but its a part of the religion. Makes sense?
Charity, if you don’t do it, it’s not a sin.
Islams Tax (what is called Zakat) is not charity. Tax, has a specific calculation (2.5% of the value), and an asset has to meet certain criteria (eg. 1 year unused) for it require the owner to pay its taxes, and the money goes to specific groups of people (the orphans, poor, etc etc). I am keeping it simple here, this is very difficult to explain in text.
Charity is what ever you want to whomever you want at any time.
This is a higher more spiritual level of commitment.