Free SIM Card Generator: IMSI, ICCID, Ki and OPc

This free SIM card generator builds the four values every programmable LTE or 5G SIM needs: the IMSI, ICCID, Ki and OPc. Make up to 10,000 at once, give every SIM up to four APNs, and download a CSV for your SIM writer plus an import file that loads the whole batch into Open5GS or Rapid5GS with one command.

It all runs in your browser, inside an isolated frame that can’t reach the network. Your keys never touch our server.

Want it offline? Download the generator as one HTML file and open it on a computer with no network. SHA-256: 008ac3610cc165e0a49db1ea81b3483103780fc03778d7e1466641f3a7797754

What the Generator Makes

Every programmable SIM needs these values, and your core needs the same ones to let it on the network.

Value What it is How the generator builds it
IMSI The SIM’s identity on your network: MCC, MNC and MSIN, 15 digits in all. Your PLMN plus a sequential subscriber number
ICCID The card’s serial number, printed on the plastic (ITU-T E.118). The last digit is a Luhn check digit. Your prefix, then the IMSI, then the check digit
Ki The 128-bit secret key the SIM shares with your HSS. Some tools call it K. 16 random bytes from your browser’s cryptographic random number generator
OP A 128-bit operator key, usually one per network. Random for each batch, or paste your own
OPc OP mixed with one card’s Ki. The SIM and the core both use it to run Milenage. AES-128(Ki, OP) XOR OP, per 3GPP TS 35.206

The SIM CSV has one row per card: ICCID,IMSI,KI,OPC. The import file adds the rest of the subscriber profile your core needs: APNs, speed cap and QoS.

How to Program SIM Cards for a Private LTE Network

  1. Pick your PLMN. It has to match the PLMN your core and your radios use. If you don’t have one yet, see the table below.
  2. Generate the batch. Set how many SIMs, your APNs and the speed cap, then download the SIM CSV and the Open5GS import.
  3. Set your SIM writer to Milenage. Enter each card’s ADM key. It comes from your card vendor; this generator doesn’t make it.
  4. Write ICCID, IMSI, Ki and OPc to each card. Use one CSV row per card. Most writers have an OP/OPc switch. Pick OPc.
  5. Set the MNC length. Write 2 to the card’s EF_AD for a 2-digit MNC like 999-99, or 3 for a 3-digit MNC like 315-010.
  6. Add your PLMN to the card’s PLMN lists. If your writer has HPLMN and EHPLMN lists, add your MCC and MNC with E-UTRAN for LTE and NG-RAN for 5G.
  7. Load the core and test one card. Run the import, put one SIM in a CPE and watch it attach before you write the rest.

Don’t open the CSV in Excel and save it again. Excel turns a 20-digit ICCID into 8.90E+19, and the real digits are gone.

Which PLMN Should a Private LTE Network Use?

If your network already has a PLMN, use it. If it doesn’t, these are the codes private networks actually use:

PLMN Use it for Notes
999-99 Any private network ITU-T E.212 sets aside MCC 999 for internal use in private networks, so it won’t clash with a carrier. This is the generator’s default.
315-010 + IBN US CBRS networks The shared CBRS HNI. Your 4-digit IMSI Block Number is the first four digits of the MSIN, which leaves 100,000 IMSIs per block. IBNs are assigned through ATIS and the US IMSI Administrator.
001-01 Labs and test benches Reserved for test networks. Fine on the bench, not for paying subscribers.
901-70 Rapid5GS cores that kept the default The Rapid5GS installer suggests it. Pick this preset, or change the core.

Watch the MNC digit count. To a phone or CPE, 99 and 099 are different networks. Open5GS takes the digit count from how you type the MNC in mme.yaml and amf.yaml, and the SIM takes it from the MNC length you write to the card.

Multiple APNs on One SIM

A lot of WISPs run more than one APN per subscriber, for example one to manage the CPE and one for the customer’s internet. The generator gives every SIM up to four APNs, which is the Open5GS limit per subscriber. Each APN gets its own IP type: IPv4, IPv6 or IPv4v6. The first APN is the default, the one the core uses when a device doesn’t ask for a specific APN.

APNs live in the core, not on the SIM, so the SIM CSV is the same either way. Set the same APN names on your CPEs. The free Rapid5GS build is happiest with one APN; Rapid5GS Pro manages multiple APNs from its web GUI.

Bulk Import SIMs into Open5GS or Rapid5GS

Open5GS doesn’t ship a CSV importer, and Rapid5GS doesn’t install open5gs-dbctl, so the generator writes an import script for mongosh. Copy it to the core and run:

mongosh --quiet mongodb://127.0.0.1/open5gs open5gs-import-999990000000001-100.js

It writes each subscriber the way the Open5GS WebUI does: your APNs, QCI 9, ARP 8, your speed cap and slice SST 1, with every number stored as the 32-bit integer the HSS expects. It skips any IMSI that’s already in the database and never edits an existing subscriber, so running it twice is safe. When it finishes, it prints how many SIMs it added. Prefer clicking? Here’s how to add subscribers in the Open5GS WebUI.

Other cores need the same values: IMSI, Ki and OPc, the Milenage algorithm, and AMF 8000. If your HSS wants OP instead of OPc, give it the batch OP. Moving existing SIMs off Baicells? See how to export IMSI, Ki and OPC from CloudCore.

Why a New SIM Won’t Attach

Most first-attach failures come down to one of these. The log lines are the ones Open5GS prints.

What you see What it means Fix
[imsi-…] Cannot find IMSI in DB The SIM isn’t in the HSS. Run the import. Check that the IMSI on the card matches the CSV.
Authentication failure(MAC failure) The Ki or OPc on the card doesn’t match the core. Rewrite the card. Make sure the writer’s OP/OPc switch was set to OPc.
Authentication failure(Synch failure) The sequence number on the card is ahead of the core, usually because the card was used on another core or the subscriber was deleted and added back. Nothing. Open5GS resyncs from the card and the next attempt works.
CPE shows no service or roaming The PLMN or MNC length doesn’t match. Make the SIM, the radio and the core agree on MCC, MNC and MNC length.
Cannot find Served TAI The radio broadcasts a PLMN or TAC the MME doesn’t serve. Fix the TAI list in mme.yaml, or the PLMN and TAC on the radio.
Invalid APN, or attached with no data The CPE asked for an APN the subscriber doesn’t have. Set the CPE’s APN to one you generated, or add it to the subscriber.

How OPc Is Calculated

Milenage, the authentication algorithm on most LTE and 5G SIMs, runs on OPc. 3GPP TS 35.206 defines it as:

OPc = AES-128(key = Ki, data = OP) XOR OP

Web Crypto has no raw AES-ECB mode, so the generator encrypts the single block with AES-CBC and an all-zero IV, which gives the same result. Every time it loads, it checks itself against the published 3GPP TS 35.208 test sets below. If either check fails, the Generate button stays off.

Value Test set 1 Test set 2
Ki 465B5CE8 B199B49F AA5F0A2E E238A6BC 0396EB31 7B6D1C36 F19C1C84 CD6FFD16
OP CDC202D5 123E20F6 2B6D676A C72CB318 FF53BADE 17DF5D4E 793073CE 9D7579FA
OPc CD63CB71 954A9F4E 48A5994E 37A02BAF 53C15671 C60A4B73 1C55B4A4 41C0BDE2

These are public test values. Never put them on a real card.

Is It Safe to Generate SIM Keys on a Website?

Normally you shouldn’t paste a Ki or OP into a website. We built this one so you don’t have to trust us, and so you can check it:

  • Nothing gets sent. The generator runs in a frame whose Content-Security-Policy sets connect-src 'none', so your browser blocks any network request it tries to make.
  • Nothing else on the page can read it. The frame is sandboxed with its own opaque origin. Analytics and other scripts on this page can’t see into it.
  • The randomness is real. Ki and OP come from crypto.getRandomValues, your browser’s cryptographic random number generator.
  • You can check it. The generator is one HTML file with one script. Download it, compare the SHA-256 above, read it, and run it on a computer with no network.

Treat the CSV and the import file like passwords. Anyone with a card’s Ki and OPc can clone that card.

Frequently Asked Questions

What is an IMSI?

The International Mobile Subscriber Identity is the number your core uses to identify a SIM. It is 15 digits: a 3-digit MCC, a 2- or 3-digit MNC, then the MSIN that identifies the subscriber. The MCC and MNC together are the PLMN.

What is the difference between Ki, OP and OPc?

Ki is the secret key unique to each SIM. OP is an operator-wide key. OPc is OP mixed with one card’s Ki. The SIM and the core run Milenage with Ki and OPc, so writing OPc to the card keeps OP off the SIM.

Can every SIM in a batch share one OP?

Yes. One OP per network is normal. Each card still gets its own Ki, so each card’s OPc is different.

Does the ICCID have to match anything?

No. LTE never sends the ICCID during attach. It only has to be unique and pass the Luhn check. The generator puts the IMSI inside the ICCID, so you can read one off the other.

How many SIMs can I generate at once?

Up to 10,000 per batch, in about a second. Need more? Run another batch starting at the next subscriber number.

Does it work for 5G standalone?

Yes. 5G AKA uses the same Ki and OPc, and the import adds slice SST 1 so Open5GS can register the SIM on 5G SA. The generator doesn’t create SUCI keys, so set up identity concealment separately if you need it.

Will the SIMs work with Nokia, Baicells or another core?

Yes. Ki, OPc, Milenage and AMF 8000 are standard, so the SIM CSV works with any core. The import file is for Open5GS and Rapid5GS.

Is the generator free?

Yes. No account and no email. We sell private LTE hardware and support, and this is a tool we wanted for our own networks.

Need the Rest of the Network?

SIMs are the easy part. We sell Nokia AZQC CBRS site kits, Baicells 436Q radios and Rapid5GS Pro. We run WISPs ourselves, so we’ll help you get it on the air. Email hello@theedgemile.com or call 205-928-6797.

Built and maintained by Josh Lambert, founder of The Edge Mile and maintainer of Rapid5GS. Updated October 19, 2026.