To understand the laws and calculations associated with the security deposit return, one must first understand what a security deposit may be used for.
California Civil Code 1950.5 specifically allows the landlord to use a tenant's security deposit for only four purposes:
For unpaid rent;
For cleaning the rental unit when the tenant moves out, returning the unit to as clean a condition as it was when the tenant first moved in;
For repair of damages caused by the tenant or the tenant's guest in excess of normal wear and tear, and
If the lease or rental agreement allows it, for the cost of restoring or replacing furniture, furnishings, or other items of personal property (including keys), other than deterioration due to normal wear and tear.