---
title: Load a local json file keypair
description: "Learn how to load a keypair from file."
---

When running your local project may sometimes want to use local keypair. The
default keypair path generated by the Solana CLI is `~/.config/solana/id.json`.

You can generate a custom keypair using the Solana CLI command
_shell`solana-keygen grind --starts-with hi:1`_. This will generate a keypair
with a public key starting with "hi" and output the keypair to a json file. You
can then load this keypair using the helper function below.

<CodeTabs storage="cookbook">

```ts !! title="Kit" file=packages/docs-examples/cookbook/development/load-keypair-from-file/kit.ts#region=load

```

```ts !! title="Legacy" file=packages/docs-examples/cookbook/development/load-keypair-from-file/legacy.ts#region=load

```

```rust !! title="Rust" file=packages/docs-examples/cookbook/development/load-keypair-from-file/rust/src/main.rs#region=load

```

</CodeTabs>
