Getting Started
Create a Fungible Token
Last updated November 25, 2025
Create a fungible token with metadata on Solana using the Token Metadata program.
What You'll Learn
This guide shows you how to create and mint a fungible token with:
- Custom name, symbol, and metadata
- Token image and description
- Configurable decimals (divisibility)
- Initial token supply
Create a Token
The following code is a fully runnable example. Below the parameters that you might want to customize are shown. You can learn more about token creation details in the Token Metadata program pages.
1// npm install @metaplex-foundation/mpl-token-metadata @metaplex-foundation/mpl-toolbox @metaplex-foundation/umi @metaplex-foundation/umi-bundle-defaults
2import {
3 createFungible,
4 mplTokenMetadata,
5} from '@metaplex-foundation/mpl-token-metadata'
6import {
7 createTokenIfMissing,
8 findAssociatedTokenPda,
9 mintTokensTo,
10} from '@metaplex-foundation/mpl-toolbox'
11import {
12 generateSigner,
13 keypairIdentity,
14 percentAmount,
15 some,
16} from '@metaplex-foundation/umi'
17import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
18import { readFileSync } from 'fs'
19
20// Initialize Umi with your RPC endpoint
21const umi = createUmi('https://api.devnet.solana.com').use(mplTokenMetadata())
22
23// Load your wallet keypair
24const wallet = '<your wallet file path>'
25const secretKey = JSON.parse(readFileSync(wallet, 'utf-8'))
26const keypair = umi.eddsa.createKeypairFromSecretKey(new Uint8Array(secretKey))
27umi.use(keypairIdentity(keypair))
28
29// Generate a new mint account
30const mint = generateSigner(umi)
31
32// Step 1: Create the fungible token with metadata
33await createFungible(umi, {
34 mint,
35 name: 'My Fungible Token',
36 symbol: 'MFT',
37 uri: 'https://example.com/my-token-metadata.json',
38 sellerFeeBasisPoints: percentAmount(0),
39 decimals: some(9),
40}).sendAndConfirm(umi)
41
42// Step 2: Mint initial supply to your wallet
43await createTokenIfMissing(umi, {
44 mint: mint.publicKey,
45 owner: umi.identity.publicKey,
46})
47 .add(
48 mintTokensTo(umi, {
49 mint: mint.publicKey,
50 token: findAssociatedTokenPda(umi, {
51 mint: mint.publicKey,
52 owner: umi.identity.publicKey,
53 }),
54 amount: 1_000_000_000_000_000, // 1,000,000 tokens with 9 decimals
55 })
56 )
57 .sendAndConfirm(umi)
58
59console.log('Token created:', mint.publicKey)
60console.log('Metadata and mint account initialized')
61console.log('Initial supply minted to:', umi.identity.publicKey)
1import { generateKeyPairSigner } from '@solana/kit';
2import { createFungible } from '@metaplex-foundation/mpl-token-metadata-kit';
3
4// Assuming rpc, rpcSubscriptions, and sendAndConfirmInstructions are set up
5// See getting-started for full setup
6
7const mint = await generateKeyPairSigner();
8const authority = await generateKeyPairSigner(); // Your wallet
9
10// Create a fungible token with metadata and mint initial supply
11const createAndMintIx = await createFungible({
12 mint,
13 authority,
14 payer: authority,
15 name: 'My Fungible Token',
16 symbol: 'MFT',
17 uri: 'https://example.com/my-token-metadata.json',
18 sellerFeeBasisPoints: 0,
19 decimals: 9,
20 tokenOwner: authority.address,
21 amount: 1_000_000_000_000_000n, // 1,000,000 tokens with 9 decimals
22});
23
24// Send the instruction (createFungible returns a single combined instruction)
25await sendAndConfirm({
26 instructions: [createAndMintIx],
27 payer: authority,
28});
29
30console.log('Fungible token created:', mint.address);
31console.log('Initial supply minted to:', authority.address);
1# Create a Fungible Token using the Metaplex CLI
2
3# Interactive wizard mode (recommended for beginners)
4mplx toolbox token create --wizard
5
6# Basic token creation (required: --name, --symbol, --mint-amount)
7mplx toolbox token create \
8 --name "My Token" \
9 --symbol "MYT" \
10 --mint-amount 1000000
11
12# Full token creation with all options
13mplx toolbox token create \
14 --name "My Token" \
15 --symbol "MYT" \
16 --description "A fungible token on Solana" \
17 --image ./token-image.png \
18 --decimals 9 \
19 --mint-amount 1000000000000000
20
21# Note: mint-amount is in smallest units
22# With --decimals 9, to mint 1,000,000 tokens: --mint-amount 1000000000000000
23# With --decimals 0 (default), to mint 1,000,000 tokens: --mint-amount 1000000
Parameters
Customize these parameters for your token:
| Parameter | Description |
|---|---|
name | Token name (max 32 characters) |
symbol | Short name of your Token (max 6 characters) |
uri | Link to off-chain metadata JSON |
sellerFeeBasisPoints | Royalty percentage (550 = 5.5%) |
decimals | Decimal places (some(9) is standard) |
amount | Number of tokens to mint |
Metadata and Images
The uri should point to a JSON file containing at least the following information. You can find more details on the Token Metadata Standard page. You need to upload the JSON and the image url so that they are accessible from everywhere. We recommend to use a web3 storage provider like Arweave. If you want to do so by code you can follow this guide.
{
"name": "My Fungible Token",
"symbol": "MFT",
"description": "A fungible token on Solana",
"image": "https://arweave.net/tx-hash"
}
