How to Generate a Seed Phrase Offline and Import It into MetaMask
You can generate a seed phrase offline, then import it into MetaMask, to create a wallet that never touched the internet during its creation. This is a standard security practice for anyone who wants to control the randomness of their wallet's key generation and avoid any risk - however small - that a software wallet's online generator could be compromised or surveilled. The process requires a computer that has never been connected to the internet (or one that you disconnect completely before starting), a trusted tool for generating the phrase, and careful manual entry into MetaMask.
Why generate a seed phrase offline
MetaMask's built-in wallet creation uses your browser's cryptographic random number generator. This is generally secure, but the browser is connected to the internet, and the entropy source is the operating system's random number pool. An attacker with remote access to your machine could, in theory, influence or read that pool. By generating a seed phrase on an air-gapped machine - one that has never been online or is physically disconnected from the network - you eliminate that entire class of risk. The phrase is created, written down, and then typed into MetaMask on your online device. The air-gapped machine never touches the internet, so the phrase cannot be intercepted during generation.
What You Need
- A computer that can be taken fully offline. A cheap laptop or a Raspberry Pi that you keep offline permanently works best. You can also use a machine you normally use online, but you must disconnect it from the internet completely - unplug Ethernet, turn off Wi-Fi, and disable Bluetooth - before you begin.
- A trusted, open-source seed phrase generation tool. The most widely recommended is Ian Coleman's BIP39 tool, available as a downloadable HTML file. You download the file while the machine is still online (or transfer it via USB from another machine), then open it in a browser on the offline machine. Do not use any online version of the tool; the whole point is that the generation happens offline.
- A pen and paper for writing down the phrase. Do not take a screenshot, save a file, or photograph it.
Step-by-Step Process
1. Prepare the Offline Machine
- If using a normally online computer, disconnect all network connections. Unplug the Ethernet cable. Turn off Wi-Fi and Bluetooth in the operating system settings. Restart the machine to ensure no background processes reconnect.
- If using a dedicated offline machine, simply ensure it has never been online and has no network hardware enabled.
2. Load the BIP39 Tool
- Transfer the Ian Coleman BIP39 HTML file to the offline machine via a USB drive. The file is a single HTML page that runs entirely in your browser's JavaScript engine. It does not make any network calls.
- Open the file in a browser on the offline machine.
3. Generate the Seed Phrase
- In the tool, ensure "12 words" is selected (or 24 words if you prefer a longer phrase; 12 is standard and secure for most purposes).
- Click "Generate" to create a random seed phrase. The tool uses the browser's
crypto.getRandomValues()function, which draws from the operating system's cryptographically secure random number generator. Because the machine is offline, no remote attacker can influence or observe this process. - Write down the 12 (or 24) words on paper in the exact order shown. Verify each word twice. Do not copy them to any digital file.
4. Verify the Phrase on the Offline Machine
- Before leaving the offline environment, use the tool to confirm you wrote the words correctly. The tool has a "Verify" section where you can re-enter the words and see that they match the generated phrase. Do this now, while the machine is still offline and you can correct any errors.
5. Transfer the Phrase to Your Online Machine
- Leave the offline machine powered off or disconnected. Take your paper copy to the computer where MetaMask is installed.
- Open MetaMask, click "Import wallet" (or the equivalent option during the initial setup), and enter the seed phrase word by word. MetaMask will recognize the phrase and generate the corresponding wallet and accounts.
6. Test the Import
- After importing, note the first account address. Then, on the offline machine (if you still have it running), use the BIP39 tool to derive the same address. The tool has a "BIP32 Derivation" section where you can enter the same seed phrase and see the derived addresses. If the addresses match, you have imported correctly.
- If they do not match, you likely made an error during transcription or import. Start over from the offline generation step.
Important Caveats
- The offline machine must be genuinely air-gapped. If you reconnect it to the internet afterward, any malware that was dormant could read the generated phrase from the browser's memory or the tool's state. Ideally, the machine stays offline permanently or is wiped clean before ever going online again.
- The BIP39 tool is a single point of trust. You must verify the integrity of the HTML file. Download it from the official GitHub repository (github.com/iancoleman/bip39) and check its SHA-256 hash against published values. A compromised copy could generate a phrase that an attacker also knows.
- Generating a seed phrase offline does not protect against physical threats. Someone who finds your paper copy, or who watches you type it in, can steal your wallet. Store the paper securely.
- This method is overkill for most users. MetaMask's online generation is adequate for everyday use. The offline method is for users who need maximum assurance - for example, if you are creating a wallet for a large amount of cryptocurrency, or if you suspect your machine might be compromised.
What to Do If the Import Fails
If MetaMask shows a "seed phrase invalid" error during import, you made a transcription or typing error. Return to the offline machine (if still available) and re-read the phrase from the paper, or generate a new one. Do not try to guess or correct words; a single wrong word or wrong order produces a different wallet. The only fix is to use the correct phrase or start over.
Not financial advice. lingose.games publishes market data and general information about digital assets. Crypto assets are volatile and you can lose everything you put in. Nothing here is a recommendation to buy, sell or hold, and we make no price predictions.
Prices are sourced from third parties and may be delayed or wrong. Verify anything you intend to act on against a primary source.