> ## Documentation Index
> Fetch the complete documentation index at: https://solana.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# Withdraw Excess Lamports

> Recover SOL above the rent-exempt minimum from token accounts, mints, and multisig accounts without changing token balances or supply.

## What Does Withdraw Excess Lamports Do?

`WithdrawExcessLamports` moves SOL held by a Token Program account above its
rent-exempt minimum to a destination account. Token balances and mint supply are
untouched — only the surplus lamports move.

This recovers SOL that was previously stranded: lamports sent to a token
account, mint, or multisig (all owned by the Token Program) could not otherwise
be moved.

### Source Reference

| Item                               | Description                           | Source                                                                                                                  |
| ---------------------------------- | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `WithdrawExcessLamports`           | The instruction (discriminator 38).   | [Source](https://github.com/solana-program/token/blob/main/pinocchio/interface/src/instruction.rs)                      |
| `process_withdraw_excess_lamports` | Processor logic and authority checks. | [Source](https://github.com/solana-program/token/blob/main/pinocchio/program/src/processor/withdraw_excess_lamports.rs) |

## Accounts

| Account       | Description                                                      |
| ------------- | ---------------------------------------------------------------- |
| `source`      | Writable. The token account, mint, or multisig to withdraw from. |
| `destination` | Writable. Receives the excess lamports.                          |
| `authority`   | Signs based on the source account type (see below).              |

## Who Can Sign

The required signer depends on the type of the `source` account:

| Source account                | Signer                                                  |
| ----------------------------- | ------------------------------------------------------- |
| Token account                 | The token account owner (or its multisig signers).      |
| Mint with a mint authority    | The mint authority.                                     |
| Mint without a mint authority | The mint account itself must sign (see the note below). |
| Multisig                      | The configured M-of-N signers.                          |

<Info>

The "mint without a mint authority" case is uncommon. When it applies, the mint
account is the signer: a program-owned (off-curve) mint signs via a CPI from its
owning program, and a keypair (on-curve) mint signs with its key.

</Info>

<Warning>

Native (wrapped SOL) token accounts are not supported and return
`NativeNotSupported`. The withdrawal cannot drop the source account below
its rent-exempt minimum.

</Warning>

## How to Withdraw Excess Lamports

The example uses a configured
[`@solana/kit`](/developers/docs/clients/official/javascript#solana-kit) client — see
[Transfer Tokens](/developers/docs/tokens/basics/transfer-tokens) for client setup.

```ts title="Withdraw excess lamports (Kit)"
import { getWithdrawExcessLamportsInstruction } from "@solana-program/token";

// source/destination: addresses of the account to drain and the lamport recipient.
// authority: a TransactionSigner that signs per the source account type.
const instruction = getWithdrawExcessLamportsInstruction({
  source,
  destination,
  authority
});

await client.sendTransaction([instruction]);
```

For a multisig authority, pass the co-signers with `multiSigners`.
