A login flow demo fails in an embarrassing way: the presenter reaches the verification screen, the script says a code was sent, and nobody has a code to type. Someone invents one on the spot, it looks nothing like a real code, and the one case that breaks real systems, a code beginning with zero, never gets rehearsed at all.
The fix is a prepared batch of placeholder codes that behave like the real thing on screen. This guide shows how to make them with the free Random PIN and OTP Code Generator on Ovatly, and it is plain about the boundary: these codes rehearse a demo, they do not secure anything.
Contents
- Quick answer
- What a demo code is, and what it is not
- Why the leading zero matters in rehearsal
- How to generate test OTP codes, step by step
- Worked example: five 6-digit codes
- Limitations and honest tradeoffs
- Common mistakes
- FAQs
- Conclusion
- References
Quick answer
Open the Random PIN and OTP Code Generator, set 6 digits per code, choose how many codes you need (up to 500), click Generate codes, and download the batch as a text file with one code per line. Use those codes to rehearse the verification screen, the message wording and the support script. They are standalone random numbers, not time-based one-time passwords: a production login flow must derive its codes from a shared secret and the clock, and no generated list can substitute for that.
What a demo code is, and what it is not
A demo code is a fixed-length string of digits drawn from a cryptographic random source. It looks like a one-time password, it fits the same input boxes, and it exercises the same screens, emails, text message templates and help desk scripts. That is the whole of its job: to let people practise the flow before real users depend on it.
A real one-time password is a different mechanism. In a time-based system, the code is calculated from a shared secret and the current time, on both the user's device and the server, so the two sides arrive at the same value without sending it. The code expires because time moves on. A batch from a generator has no shared secret and no clock behind it, so nothing can verify it in that way, and it never expires on its own.
Keeping that distinction clear is what makes the demo honest. The screens can be rehearsed end to end. The security cannot, and the guide below never pretends otherwise.
Why the leading zero matters in rehearsal
Random digits mean roughly one code in ten begins with a zero. Real users will receive those codes, and a surprising amount of software mishandles them: a spreadsheet quietly turns 004730 into 4730, a form field treats the entry as a number and drops the zero, a support agent reads the code back one digit short.
A generated batch surfaces this before launch because leading zeros are kept, not stripped. If your demo list contains a code starting with zero, use it deliberately. Type it into every screen, paste it into the message template, and read it aloud in the support rehearsal. Anywhere it arrives shortened, you have found a bug at the cheapest possible moment.
How to generate test OTP codes, step by step
- Open the Random PIN and OTP Code Generator and set the digits per code. Six is the length most login flows use, so it is the right default for a demo.
- Set how many codes to generate, up to 500. A handful serves a screen rehearsal; a larger batch suits a classroom exercise or a full script run-through.
- Click Generate codes. The list appears with leading zeros preserved.
- Copy the codes, or download them as a text file with one code per line, and keep that file with the demo script so every presenter works from the same list.
- Scan the list for duplicates if your scenario needs unique codes, and remove any repeats by hand.
Worked example: five 6-digit codes
One run of the generator, set to 6 digits and 5 codes, produced this batch:
492715
004730
835137
959162
298439
Read it the way a demo lead should. Four codes are unremarkable, and that is fine; they fill the ordinary verification screens. The second code, 004730, is the valuable one. Put it in the hands of whoever plays the user, have them read it from the message template exactly as written, and watch each system it passes through. If the code arrives anywhere as 4730, the demo has done real work. Note also what the batch cannot show: none of these codes will stop working after thirty seconds, because nothing about them is tied to time.
Limitations and honest tradeoffs
These codes are not predictable from previous ones, because each is drawn independently from a cryptographic random source using crypto.getRandomValues with rejection sampling, so every digit carries equal odds and no pattern builds up across a batch. That randomness is genuine, but it buys less than it appears to. Unpredictability is only one property of a real OTP system; the others, expiry and server-side verification against a shared secret, are absent here by design.
Nothing is stored, either. Leave the page and the list is gone unless you downloaded it, which is the right behaviour for a generator and a real constraint on demo planning.
There is one legitimate production-adjacent use worth naming precisely. Pre-generated single-use codes can work in a real system when each code is stored hashed and given an expiry by that system. That is a design the system itself implements around the codes; it is still not a substitute for a time-based OTP or an app or SMS flow, and this generator plays no part in it beyond producing the numbers.
Common mistakes
- Presenting demo codes as a working OTP feature. The screens are real; the verification is not. Say so in the demo, every time.
- Stripping leading zeros when copying codes into a spreadsheet. The zero is part of the code. Keep the column formatted as text, or work from the downloaded text file.
- Regenerating between rehearsals. A fresh batch each run means presenters learn nothing about the specific codes. Generate once, download, reuse.
- Skipping the duplicate check. Random batches can repeat a code. If the scenario assumes uniqueness, check the list first.
- Using placeholder codes in a live flow. Nothing about a generated batch expires or verifies. A production flow needs codes derived from a shared secret and the clock.
FAQs
Are these codes real one-time passwords? No. They are standalone random numbers generated for demos, test data and placeholders. A real one-time password is derived from a shared secret and the current time, so it changes on a schedule and can be verified by the server. These codes cannot be verified that way and must never stand in for a live OTP system.
How many codes can I generate at once? Up to 500 in a single batch. You choose the number of digits per code and how many codes you want, generate them, then copy the list or download it as a text file with one code per line.
Can a batch contain the same code twice? Yes. The codes are drawn at random, so duplicates can occur by chance, especially in large batches drawn from a short code length. If your demo needs every code to be unique, check the downloaded list and remove repeats before you use it.
Why do some codes start with zero? Because every digit is equally likely, a code such as 004730 is just as valid as any other. Leading zeros are kept rather than stripped, which is exactly why they are useful in a demo: any screen, message template or script that drops the zero will fail visibly before it reaches real users.
Are the codes stored anywhere after I generate them? No. Nothing is kept once you leave the page. If you need the same codes again for a second run of the demo, download the batch as a text file and keep that file with your demo materials.
Conclusion
A good login demo runs on prepared codes, not improvised ones: one downloaded batch, reused across rehearsals, with a leading-zero code deliberately in the mix. The Random PIN and OTP Code Generator produces that batch in seconds. For the companion question of why machine-made codes outperform the ones people invent, read Why Random PINs Beat Ones You Invent Yourself. For more guides in this series, see our Security and Privacy Utilities guides.
References
- MDN Web Docs, on the Web Crypto API and
crypto.getRandomValues: https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues - RFC 6238, on time-based one-time passwords and how they are derived from a shared secret and the clock: https://www.rfc-editor.org/rfc/rfc6238