piapia123
en

Serial Number Generator

Generators

Everything runs locally in your browser — nothing is uploaded

Output

Two modes, two kinds of identifier: sequential numbers (order numbers, student IDs, batch codes, asset tags — anything shaped like a fixed piece of text plus an incrementing number) and random keys (`XXXX-XXXX-XXXX-XXXX` licence keys, activation codes, redemption codes). Zero padding is a requirement, not a nicety. Serial numbers almost always need a fixed width (`ORD-0001` rather than `ORD-1`), and the reason is sorting: sorted as strings, `ORD-10` comes before `ORD-2`. How wide depends on how many numbers the batch will ever hold — a thousand means four digits — and only you know that, so the default is four, covering up to 9999. Random keys are described by a pattern with three placeholders: `X` for a letter or digit, `A` for a letter, `N` for a digit (either case — typing `xxxx-xxxx` works); everything else (dashes, brackets, spaces) is kept as written. So mixed shapes like `XXX-NNNN-AAA` work too. The alphabet deliberately omits `0`, `O`, `1`, `I` and `L` — these strings get copied out of an email, read aloud down a phone line and typed into a box that will not accept a paste, and a single misread costs a failed activation. That is worth more than a few extra characters. The separator is an option too, because it decides whether you can paste the result straight in: newlines for a spreadsheet, commas for a sentence, spaces for a command line. Making you generate and then find-and-replace leaves the job half done. Negative numbers are never zero-padded: `String(-1).padStart(4, '0')` gives `00-1`, with the minus sign stranded in the middle, so the sign is checked before padding.

Features

  • Two modes: sequential serial numbers, or random keys from a pattern
  • Your own prefix and suffix (the fixed parts of an order number, student ID or batch code)
  • Key patterns with `X` (letter or digit), `A` (letter) and `N` (digit) placeholders, mixable freely
  • Adjustable start and step, and a negative step numbers backwards
  • Zero padding with a configurable width, 4 by default; 0 means none, and negatives are left unpadded so `00-1` never appears
  • Key alphabet omits `0 O 1 I L`, and rejection sampling keeps every character equally likely
  • Up to 5000 numbers at a time
  • Output separated by line breaks, spaces or commas, ready to paste into a sheet, a sentence or a shell
  • Every option takes effect immediately
  • Runs locally with no requests — the keys you generate never show up in anyone else’s logs

How to use

  1. Choose the mode: sequential numbers or random keys
  2. Sequential: fill in the prefix, suffix, start value, step and padding width
  3. Random keys: write a pattern such as `XXXX-XXXX-XXXX-XXXX`, with a prefix or suffix if you want
  4. Set how many you need and the separator
  5. Click Copy to take the batch

FAQ

Why is zero padding necessary?
Because of string sorting. A list of `ORD-1`, `ORD-10`, `ORD-2` sorts as `ORD-1`, `ORD-10`, `ORD-2` — number ten before number two, which looks like the data is wrong. Padded to four digits (`ORD-0001` … `ORD-0010`) the string order matches the numeric order, and sorting, comparing and deduplicating all behave. This matters especially for identifiers stored as strings in a database.
Can I use the generated keys as real product licence keys?
You can generate them; validating and issuing them is still your job. This tool only rolls unpredictable strings — it makes no network requests and records nothing, which is exactly what makes it suitable (your keys never land in someone else’s logs). Two things to weigh: the 16-character `XXXX-XXXX-XXXX-XXXX` shape carries roughly 78 bits of entropy, which is plenty, but a pattern with few placeholders is not enough (`NNNN` is only ten thousand possibilities); and a leaked key cannot be revoked, so real issuance should match each key against a server-side allowlist.
Why is there no 0, O, 1, I or L in the keys?
Because people misread them. The life of such a string is to be copied into an email, read out over the phone and typed into a box that refuses a paste — and `0/O` and `1/I/L` get confused at every one of those steps. Dropping those five characters takes the alphabet from 36 to 31, costing about 0.2 bits of entropy per character, and saves a great many support tickets. Short IDs and one-time codes are built on the same reasoning.
Can it generate a serial number with the date in it?
Put the date in the prefix — for instance `2026-0927-` — and let the number increment as usual. The tool deliberately has no `{date}` placeholder, because that would make the output depend on the day it was generated; a generator where the same options always give the same result is far easier to check, and changing the date is a one-line edit to the prefix.
How many can it generate at once?
Five thousand. That limit is deliberate: beyond it the result area and the copied text become unwieldy, and the use cases — a batch of staff numbers, a batch of asset tags — do not reach that size. For more, set the start value to just past the end of the previous batch and click again.

Related tools