---
title: How to Restore a Keypair from a Mnemonic
description: "Learn how to restore keypairs from a mnemonic on Solana"
---

Many wallet extensions use mnemonics to represent their secret keys. You can
convert the mnemonic to Keypairs for local testing.

## Restoring BIP39 format mnemonics

<CodeTabs storage="cookbook" flags="r">

```ts !! title="Kit" file=packages/docs-examples/cookbook/wallets/restore-from-mnemonic/bip39-kit.ts#region=bip39

```

```ts !! title="Legacy" file=packages/docs-examples/cookbook/wallets/restore-from-mnemonic/bip39-legacy.ts#region=bip39

```

```rust !! title="Rust" file=packages/docs-examples/cookbook/wallets/restore-from-mnemonic/rust/src/main.rs#region=bip39

```

</CodeTabs>

## Restoring BIP44 format mnemonics

<CodeTabs storage="cookbook" flags="r">

```ts !! title="Kit" file=packages/docs-examples/cookbook/wallets/restore-from-mnemonic/bip44-kit.ts#region=bip44

```

```ts !! title="Legacy" file=packages/docs-examples/cookbook/wallets/restore-from-mnemonic/bip44-legacy.ts#region=bip44

```

</CodeTabs>
