← All articles

How to Close Solana Token Accounts Manually (CLI) vs Using a Cleaner

July 13, 2026 · 7 min read

You don't need a third-party tool to close a Solana token account. The official command-line tools can do it, they're free, and they hand you back the same ~0.002 SOLrent deposit a cleaner would. So when is doing it by hand worth the effort, and when does a cleaner actually earn its cut? Here's the honest comparison, with the exact commands.

What closing an account actually does

Every token account on Solana holds a small refundable deposit — its rent— of roughly 0.002 SOL. When you sell a position to zero, the account stays open with that deposit still locked inside. Closing it returns the SOL to you. It's a standard, reversible-free operation: you're not paying a fee to close, you're retrieving your own deposit. If the concept is new, start with how to reclaim SOL rent.

The manual route: Solana CLI, step by step

The spl-token CLI (part of the Solana tool suite) closes empty accounts directly from your own keypair. First, list what you have:

  • spl-token accounts — shows every token account and its balance. The zero-balance ones are your candidates.
  • spl-token close --address <ACCOUNT> — closes a single empty account and sends the rent back to your wallet.
  • For a Token-2022 account, add the program flag: spl-token close --address <ACCOUNT> --program-2022.

If an account still holds dust you want gone, burn it first with spl-token burn <ACCOUNT> <AMOUNT>, then close it. A worthless NFT works the same way: burn the single token, then close its account to recover the rent. Everything stays non-custodial — you sign locally with your own keypair, no website ever sees your key.

Where the manual route gets tedious

The CLI is precise and free, but it scales badly. A few things add up fast:

  • One account at a time.There's no built-in "close everything empty" — you close accounts individually, or script a loop yourself and hope you didn't include one that still matters.
  • You have to spot the empties.Reading balances by hand across 150+ accounts is error-prone, and it's easy to miss Token-2022 accounts if you forget the program flag.
  • NFTs are two steps each. Burn, then close, per token — slow if a spam mint dropped dozens of them on you.
  • Setup cost. You need the Solana CLI installed and a local keypair configured before you can run any of it.

For a developer with ten dead accounts, that's five minutes. For an active wallet with a couple hundred empties and a pile of airdropped NFTs, it's an afternoon of careful copy-paste.

Curious how much is locked in your own wallet?

Run a free check — no connect

The cleaner route: one scan, one signature

A wallet cleaner does the same on-chain work, batched. It scans the wallet, flags every empty token account, dust position, and worthless NFT — classic SPL and Token-2022 — and closes them in a single transaction you sign yourself. No CLI, no keypair file, no per-account loop. With SolHealth you can paste an address and see the reclaimable amount for free before you connect anything, then sign once to get it back.

The trade-off is the fee. Cleaners take a percentage of what you recover — the market sits around 2%, so you keep ~98%. SolHealth charges a flat 2% only on SOL you actually reclaim, taken inside the same transaction you sign. The CLI has no fee; the cleaner charges a small one and saves you the manual labor.

Which should you use?

There's no universally right answer — it depends on your wallet and your comfort with the terminal:

  • Do it manuallyif you're comfortable in a terminal, have only a handful of accounts, and want to pay literally zero. Full control, no middleman.
  • Use a cleanerif you have dozens or hundreds of accounts, spam NFTs to burn, Token-2022 accounts you'd rather not track by hand, or you simply don't want to install anything. One scan, one signature.

A note for builders: leftover program buffer accounts from interrupted deploys also lock SOL, and they're easy to forget. You can close those from the CLI too — or let a scan surface them so you don't leave rent stranded across old programs.

The short version

Closing token accounts is your right, and the CLI proves you never have to hand anyone your keys to reclaim rent. Do it by hand when the count is small and you like the control; reach for a non-custodial cleaner when the count is large and your time is worth more than 2%. Either way, the SOL was always yours — the only question is how much effort you want to spend getting it back.