> ## 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.

# Rent (storage deposit)

> Every Solana account holds a refundable deposit, proportional to its size, for the space it takes up. How much it is, who pays it and how to get it back.

## In short

Every account holds a small refundable deposit for the space it takes up. Opening a USDC account for a new customer costs about 0.0015 SOL, which comes back if the account is closed.

<div className="sol-usedin not-prose" data-concept="rent">
<span className="sol-usedin-label">You've used this in:</span> [Payments <span className="sol-usedin-step">Step 4</span>](/developers/docs/payments/checkout/go-live) [Pay-per-call <span className="sol-usedin-step">Step 4</span>](/developers/docs/payments/paywall-api/go-live) [Tokenized asset <span className="sol-usedin-step">Step 3</span>](/developers/docs/assets/issue-asset/local) [Trade settlement <span className="sol-usedin-step">Step 3</span>](/developers/docs/defi/settle-trade/local)
</div>

## What the deposit is

Every <span className="sol-chip" data-concept="account"><Tooltip headline="Accounts" tip="Everything on Solana (balances, tokens, programs, app data) lives in accounts: records at an address, each with an owner that is allowed to change it." cta="Learn more" href="/developers/docs/core/accounts">account</Tooltip><span className="nojs-only"> ([Accounts](/developers/docs/core/accounts): Everything on Solana (balances, tokens, programs, app data) lives in accounts: records at an address, each with an owner that is allowed to change it.)</span></span> must hold
a minimum balance of lamports (1 SOL = 1,000,000,000 lamports) to keep its data
stored on the network. The amount depends only on the account's size. It is a
deposit, not a fee: nothing is deducted over time, and the full balance comes
back when the account is closed.

The runtime and RPC methods still call this the **rent-exempt minimum**. Ongoing
rent collection is disabled, and the `rent_epoch` field that tracked it is
deprecated.

## How much it costs

The minimum balance is:

```text
(128 + data size in bytes) × lamports per byte
```

The 128 bytes cover the account's own metadata. The lamports-per-byte rate is a
network parameter in the Rent sysvar that changes through feature activations. [SIMD-0437](https://github.com/solana-foundation/solana-improvement-documents/blob/main/proposals/0437-incremental-rent-reduction.md)
lowers it in stages. At the time of writing (October 2026), mainnet and devnet
use 5,080 lamports per byte, which gives:

| Account                                | Data size   | Minimum balance                     |
| -------------------------------------- | ----------- | ----------------------------------- |
| Wallet (system account, no data)       | 0 bytes     | 650,240 lamports (0.00065024 SOL)   |
| Token account (original Token program) | 165 bytes   | 1,488,440 lamports (0.00148844 SOL) |
| Account with 1,500 bytes of data       | 1,500 bytes | 8,270,240 lamports (0.00827024 SOL) |

Don't hard-code these numbers. Ask the network with
[`getMinimumBalanceForRentExemption`](/developers/docs/rpc/http/getminimumbalanceforrentexemption),
which returns the current value for a given size:

<Tabs>
<Tab title="Kit">
<div className="sol-tab-label">Kit</div>

```ts highlight={6}
import { createSolanaRpc } from "@solana/kit";

const rpc = createSolanaRpc("http://localhost:8899");

const space = 1500n; // bytes
const lamports = await rpc.getMinimumBalanceForRentExemption(space).send();
console.log("Minimum balance for rent exemption:", lamports);
```

<div className="sol-run" data-run="cookbook/accounts/calculate-rent/calc-core" data-tab="Kit">
<div className="sol-run-bar"><button type="button" className="sol-run-btn">Run</button><span className="sol-run-note">Output from a local Surfpool network</span></div>
<div className="sol-run-out">

```text Output
Minimum balance for rent exemption: 11330880n
```

</div>
</div>

</Tab>
<Tab title="Web3.js v3">
<div className="sol-tab-label">Web3.js v3</div>

```ts highlight={7}
import { Connection } from "@solana/web3.js";

const connection = new Connection("http://localhost:8899", "confirmed");

// allocate 1.5k bytes of extra space in the account for data
const space = 1500;
const lamports = await connection.getMinimumBalanceForRentExemption(space);
console.log("Minimum balance for rent exemption:", lamports);
```

<div className="sol-run" data-run="cookbook/accounts/calculate-rent/calc-core" data-tab="Web3.js v3">
<div className="sol-run-bar"><button type="button" className="sol-run-btn">Run</button><span className="sol-run-note">Output from a local Surfpool network</span></div>
<div className="sol-run-out">

```text Output
Minimum balance for rent exemption: 11330880n
```

</div>
</div>

</Tab>
<Tab title="Rust">
<div className="sol-tab-label">Rust</div>

```rust
use solana_client::nonblocking::rpc_client::RpcClient;
use solana_commitment_config::CommitmentConfig;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let client = RpcClient::new_with_commitment(
        String::from("http://localhost:8899"),
        CommitmentConfig::confirmed(),
    );

    let data_len = 1500;
    let rent_exemption_amount = client
        .get_minimum_balance_for_rent_exemption(data_len)
        .await?;

    println!("{rent_exemption_amount}");

    Ok(())
}
```

<div className="sol-run" data-run="cookbook/accounts/calculate-rent/calc-core" data-tab="Rust">
<div className="sol-run-bar"><button type="button" className="sol-run-btn">Run</button><span className="sol-run-note">Output from a local Surfpool network</span></div>
<div className="sol-run-out">

```text Output
11330880
```

</div>
</div>

</Tab>
<Tab title="Web3.js (legacy)">
<div className="sol-tab-label">Web3.js (legacy)</div>

<Warning>
  **`@solana/web3.js` 1.x is no longer actively maintained**

  It receives critical fixes only. Use [Kit](/developers/docs/clients/official/javascript#solana-kit) for new code. To migrate existing code, follow the [Kit upgrade guide](https://www.solanakit.com/docs/upgrade-guide), or the [web3.js v3 migration guide](https://github.com/solana-foundation/solana-web3.js/blob/main/docs/web3js-v1-to-v3-migration.md) to keep the class-based API.

  To run this code, install 1.x with `npm install @solana/web3.js@1`. A plain `npm install @solana/web3.js` installs v3, which this code doesn't run on.
</Warning>

```ts highlight={7}
import { Connection } from "@solana/web3.js";

const connection = new Connection("http://localhost:8899", "confirmed");

// allocate 1.5k bytes of extra space in the account for data
const space = 1500;
const lamports = await connection.getMinimumBalanceForRentExemption(space);
console.log("Minimum balance for rent exemption:", lamports);
```

<div className="sol-run" data-run="cookbook/accounts/calculate-rent/calc-core" data-tab="Web3.js (legacy)">
<div className="sol-run-bar"><button type="button" className="sol-run-btn">Run</button><span className="sol-run-note">Output from a local Surfpool network</span></div>
<div className="sol-run-out">

```text Output
Minimum balance for rent exemption: 11330880
```

</div>
</div>

</Tab>
</Tabs>

<Note>
  Local test networks such as Surfpool and `solana-test-validator` still use the
  older rate of 6,960 lamports per byte, so the output above (11,330,880
  lamports for 1,500 bytes) is higher than what mainnet returns.
</Note>

## Who pays, and who gets it back

The account that creates a new account funds its deposit. In practice:

- **Payments.** A customer who has never held USDC has no USDC
  <span className="sol-chip" data-concept="token-account"><Tooltip headline="Token accounts" tip="Wallets don't hold tokens directly. Each token (USDC, or your own asset) gets a small account owned by the wallet, and transfers move between these accounts." cta="Learn more" href="/developers/docs/tokens/basics/create-token-account">token account</Tooltip><span className="nojs-only"> ([Token accounts](/developers/docs/tokens/basics/create-token-account): Wallets don't hold tokens directly. Each token (USDC, or your own asset) gets a small account owned by the wallet, and transfers move between these accounts.)</span>.</span>
  Whoever sends them their first USDC usually creates it and pays about 0.0015
  SOL at the current rate. Your app can pay this for its users, together with
  their network fees, through [fee sponsorship](/developers/docs/core/fees/fee-sponsorship).
- **Assets.** Token-2022 associated token accounts are slightly larger (170
  bytes, 1,513,840 lamports at 5,080 lamports per byte) because they carry the
  `ImmutableOwner` extension. Each further extension adds space, and so a
  larger deposit.
- **Programs.** A program pays for each account it creates, from the payer
  account passed into the instruction.

When an account is closed, its whole balance moves to an address chosen by the
account's owner or close authority. For token accounts, see
[close a token account](/developers/docs/tokens/basics/close-account). An account whose
balance drops to zero is removed by the network.

## Related

- [Rent state transitions](/developers/docs/core/accounts/modification-rules#rent-state-transitions):
  the rules the runtime enforces when an account's balance changes. New
  accounts must always hold at least the minimum balance.
