Using tax havens can be legal, depending on the purpose and the way in which individuals or corporations utilize them. Many use tax havens for legal tax optimization and financial planning. However, tax havens can also be used for illegal activities such as tax evasion, money laundering, and hiding assets from creditors or law enforcement. The legality often hinges on compliance with the tax laws of the country in which the taxpayer resides or operates and international laws.