Serial number generator — unique codes from your own pattern

Type a pattern such as TR-XXXX-XXXX and the tool fills each placeholder with a random character, makes up to 1,000 serials with no duplicates in the batch, and tells you how many different serials the pattern allows.

Live demo · real result from this tool
X = character from the set below, # = digit, @ = letter, \ = take the next character literally.

Press Generate to create a result.

Processed on your device — nothing is uploaded.

How to use the serial number generator

  1. Type a Pattern. Use X for a character from the chosen set, # for a digit, @ for a letter, and a backslash \ before any character you want to keep literally. Everything else stays as typed.
  2. Pick the Characters for X: A–Z and 2–9 without look-alikes (the default), A–Z and 0–9, A–Z only, 0–9 only, or Hex 0–F.
  3. Set How many serials (up to 1,000) and press Generate.
  4. Copy the list. Possible serials shows how many different values the pattern can make.

What it does and when to use it

Serial numbers label things that need to be told apart: devices on a production line, warranty cards, asset tags, event tickets, gift cards or test records. Most organisations want a fixed shape, such as a short prefix, a dash and a block of characters, so the codes look consistent and are easy to read out over the phone. A pattern gives you that shape and leaves the random part to the tool.

The default character set skips 0, 1, I and O, which are easy to confuse on a printed label. If your serials should count up instead of being random, the order number generator and the invoice number generator make sequential numbers. To turn a serial into a scannable retail barcode number, you need a check digit, which the EAN-13 generator adds.

How it works

The tool reads the pattern one character at a time. Each X, # or @ is replaced by a character chosen with crypto.getRandomValues, with every option equally likely. Repeats within a batch are thrown away and redrawn.

Possible serials is the product of the choices at each placeholder. For TR-XXXX-XXXX with the 32-character default set, that is 32^8 = 1,099,511,627,776. When the number goes above 10^15 the tool shows it as a power of two instead.

Worked examples

  • The default pattern. TR-XXXX-XXXX gives serials like TR-URXC-UDDB and Possible serials: 1,099,511,627,776.
  • Digits and letters in fixed places. SN-####-@@ gives values like SN-0223-CB: 10^4 × 24^2 = 5,760,000 possible serials.
  • A literal letter. \X-## keeps the X fixed and gives Possible serials: 100.
  • Asking for too many. The pattern # has only 10 values, so a request for 20 stops with “Only 10 distinct values fit this pattern — ask for fewer or make it longer.”

Limits and tips

  • A pattern with no X, # or @ is refused with a message, since every serial would be the same.
  • Keep the pool far larger than the number of serials you will ever issue. That makes guessing a valid serial hard.
  • Random serials do not sort by date. Add a date or batch prefix to the pattern if you need that.

Frequently asked questions

How do I put a real letter X, # or @ in the serial?
Put a backslash in front of it. The pattern \X-## keeps the X as a fixed letter and fills only the two # marks, so you get serials like X-90 and X-10.
Are the serials unique?
Within one batch, yes. The tool keeps drawing until it has the number you asked for with no repeats, and it refuses if the pattern cannot hold that many. It cannot see serials from earlier batches, so check new ones against your records before use.
Which letters does @ use?
The @ placeholder always uses the 24 capital letters A to Z without I and O, whatever you pick for X. That avoids confusion with the digits 1 and 0 on labels.
Can I use these as software licence keys?
You can use them as the visible key, but random characters alone prove nothing. A real licence system also stores each issued key, or signs it, so a made-up key in the same format is rejected.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close