Skip to the page
Open Raven

How to import a Solana CLI keypair (id.json) into Phantom

Phantom does not open id.json files. The file holds your private key as a list of 64 numbers, while Phantom shows and takes keys as base58 text. Convert the numbers to base58, then paste the result into Phantom’s Import Private Key screen with Solana selected.

By the Raven Wallet team · Updated · 7 min read

The short answer

  1. Note the wallet’s address with solana address, so you can check it later.
  2. Open the id.json file, copy everything in it, from [ to ], and convert it to base58.
  3. In Phantom, choose Import Private Key, pick Solana, paste the base58 key and import.
  4. Check the address Phantom shows matches the one from step 1.

The key is the same in both places. Nothing moves on chain, and there is no fee: Phantom just starts signing with the same key the command line uses.

What is inside an id.json file?

solana-keygen new writes a keypair file. Solana’s docs say that “by default, this file is stored at ~/.config/solana/id.json”, where ~ is your home folder. If you use a different file, solana config get shows which one the CLI reads, on its Keypair Path line.

Inside is one line like [174,47,154,...]: 64 numbers, each from 0 to 255. Those are the 64 bytes of a Solana private key. The first 32 are the secret seed and the last 32 are the wallet’s public key, which is why the file opens exactly one wallet.

Anza’s docs are blunt about it: “This file contains your unencrypted keypair.” Anyone who gets a copy of the file can empty the wallet. Anza also calls file system wallets “the least secure method of storing SOL tokens.”

The same key, written asLooks likeRead by
Byte array (id.json)[174,47,154,...], 64 numbersThe Solana CLI, most code
Base58One string of 87 or 88 letters and numbersPhantom, Solflare and other wallet apps

Step 1: note the address

Run solana address for the default file, or solana-keygen pubkey followed by the file’s path for any other one. Both print the wallet’s public address. Write it down or keep the terminal open. You will compare it with Phantom at the end.

Step 2: convert the key to base58

You have two good options. Both keep the key on your own computer.

In your browser, with nothing sent

Open the Solana private key converter, paste the whole contents of id.json, brackets included, and it shows the wallet the key opens and gives you the base58 form to copy. It runs in your browser with its built-in Web Crypto and sends nothing anywhere. You can load the page, switch off your internet, then paste.

A warning that applies to every site, including ours: pasting a private key into a web page is only as safe as that page and the computer you use. A page could send the key anywhere it likes, and you cannot tell by looking. Only use a converter you trust, opened from an address you typed yourself, never from a link someone sent you. Pages that ask for keys out of the blue are how most wallets get drained, as how Solana wallet drainers work explains.

On the command line, with no website at all

You already have a terminal open, so you can convert it there. This one line uses Node.js, needs no packages, and prints the base58 key for the file at the end of the line (macOS or Linux):

node -e "const A='123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';const b=JSON.parse(require('fs').readFileSync(process.argv.at(-1),'utf8'));let n=0n;for(const x of b)n=n*256n+BigInt(x);let s='';while(n>0n){s=A[Number(n%58n)]+s;n/=58n}for(const x of b){if(x)break;s='1'+s}console.log(s)" ~/.config/solana/id.json

It reads the 64 numbers, treats them as one big number and writes it out in base58, the alphabet Solana uses. The key ends up on your screen, so do it with nobody watching and nothing recording, then clear the terminal.

Watch out for guides that suggest base58 -d. That decodes base58 into raw bytes, which is the opposite direction, and its output is neither a keypair file nor a key Phantom takes.

Step 3: import it into Phantom

Get Phantom only from phantom.com or your phone’s official app store. Then follow Phantom’s own steps.

WhereSteps from Phantom’s help centre
Extension, new installClick the Phantom icon, then I Already Have a Wallet, then Import Private Key. Name the account, select the network, paste the key, click Import, then set a password.
Extension, existing walletProfile avatar (upper left), Manage Accounts (the pencil icon), the + in the upper right, Import Private Key. Choose the network, paste the key, click Import.
Phone, new installOn the welcome screen, More Options, then Import Private Key. Select the network, paste the key, tap Import.
Phone, existing walletProfile avatar, Settings, Manage Accounts, the + in the upper right, Import Private Key. Choose the network, paste the key, tap Import.

Steps as Phantom’s help centre gives them on 13 November 2026.

Pick Solana as the network. Phantom’s troubleshooting page says choosing the wrong network can cause an “Incorrect format” error.

Step 4: check the address matches

Copy the new account’s address in Phantom and compare it with the one from step 1. They must be identical, every character. If they match, Phantom now controls the same wallet as your CLI, with the same SOL, coins and history.

If they do not match, you converted a different file than the one you checked, or something extra was pasted with the key. Start again from the file solana config get names.

If Phantom says “Incorrect format”

  • You pasted the byte array. Phantom’s help pages describe no byte array import, so convert to base58 first.
  • The wrong network is selected. Choose Solana, as Phantom’s troubleshooting page advises.
  • Something extra came along. A space, a line break or quote marks around the key.
  • It is not a private key. A public address is 32 to 44 characters, about half the length of a private key, and cannot be imported.

More causes, and the formats other apps use, are in import and export Phantom private keys.

What about the seed phrase solana-keygen printed?

When solana-keygen new makes a file, it also prints “Save this seed phrase and your BIP39 passphrase to recover your new keypair”. It is tempting to type those words into Phantom’s Import Recovery Phrase screen instead. That can open a different, empty wallet.

A recovery phrase makes wallets along a derivation path, and the CLI and Phantom do not use the same one. Anza’s docs say the CLI’s phrase prompt uses “solana’s base derivation path m/44'/501'” by default, and Phantom uses a longer path for its accounts. The private key has no path: one key, one address. That is why importing the key is the reliable route. The details are in Solana derivation paths explained, and the difference between the two is in seed phrase vs private key.

After the import

  • Keep id.json backed up. Phantom says a key imported on the phone “doesn’t automatically” appear in the extension, and that restoring your main wallet from its recovery phrase “won’t restore those imported wallets.” Your file, or the base58 key, stays the only backup.
  • Do not delete the file if the CLI still needs it. Deploys and scripts that sign with id.json keep working. Both now hold the same key.
  • Treat the key as exposed more widely. It now lives in two places. For anything holding real money, a fresh wallet made in Phantom, and a move of the funds to it, is safer than a key that has sat in a plain text file.
  • Never send the file or the key to anyone. Phantom Support “will never ask for your recovery phrase or private key.”

If you run many wallets

Developers and traders often end up with a folder of keypair files. Raven is a Solana wallet manager that holds many wallets in one place. You can bring wallets in with a seed phrase or a private key, and a picker shows what each account holds before you add it. Keys are made and locked in your browser with your password, and Raven’s server keeps only that locked copy. Raven is open to everyone: open Raven. How imports work is on the Import page.

Questions

Can I import the id.json file into Phantom directly?

No. Phantom’s import asks you to paste a private key, and its help pages describe no file import. Convert the 64 numbers to base58 and paste that.

Is it safe to convert my key on a website?

Only on a page you trust that does the work in your browser and sends nothing. The safest route is the one-line Node command above, which never touches the internet.

Will my wallet’s address change?

No. The same key always opens the same address. If Phantom shows a different one, the key you pasted came from a different file.

Can I go the other way, from Phantom to the CLI?

Yes. Export the key from Phantom, then save it as a keypair file. The private key converter can download it as the 64-number .json file the CLI reads.

Sources

Raven takes a recovery phrase or a private key, and shows what each wallet holds before you add it.

Open Raven

See how Raven does it: How keys are kept, Backup and recovery, Import, Private key converter.