---
title: How to Generate Mnemonics for Keypairs
description:
  "Mnemonics make it easy for users to store their keypair's secret. Learn how
  to use mnemonics on Solana."
---

One way to generate a Keypair is through the use of a Mnemonic. Mnemonics are
generally used to make the user experience within wallets better than a Keypair
file by using a list of readable words (instead of a shorter string of random
numbers and letters).

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

```ts !! title="Typescript" file=packages/docs-examples/cookbook/wallets/generate-mnemonic/typescript.ts#region=mnemonic

```

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

```

</CodeTabs>
