Knowledge base
How to clean up empty Solana token accounts
Published
A safe, step-by-step walkthrough of finding and closing empty SPL token accounts.
Empty token accounts are the safest kind of cleanup: the balance is exactly zero, so a single close instruction returns the rent with no destructive step. A good workflow scans both the SPL Token program and Token-2022, filters for a zero balance, verifies the account is not delegated or frozen, batches close instructions into transactions that fit Solana size limits, simulates them, and then asks the wallet owner to sign.
