Random Sample Generator Calculator

Pick sample IDs from your lot. Choose range or list, then generate without repeats instantly. Download CSV or PDF for clean inspection records everywhere.

Choose a source for IDs to sample.
Number of unique IDs selected.
Use for repeatable results.
Population equals end minus start plus one.
Sorting keeps the same sampled set.
Duplicates are removed before sampling.
Clear results
Example data table
Lot ID Population IDs Sample size Sample output (example) Use case
LOT-2401 1-100 10 7, 81, 13, 56, 92... Incoming inspection
LOT-2402 Batch-A items 8 A-1002, A-1011... In-process checks
LOT-2403 1-500 20 14, 155, 302... Final audit sampling
These rows show typical sampling scenarios for quality teams.
Formula used

This tool performs simple random sampling without replacement. Each ID has equal selection probability, and no ID can appear twice.

  • Population size (N): number of unique IDs available.
  • Sample size (n): number of unique IDs selected, with 1 ≤ n ≤ N.
  • Core method: partial Fisher-Yates shuffle using a uniform random index: j = i + U(0, N-i-1), then swap elements i and j.
  • Output: first n elements after the partial shuffle.
How to use this calculator
  1. Select Range to sample numeric IDs, or List to sample pasted IDs.
  2. Enter Sample size (n) based on your inspection plan.
  3. Optional: add a Seed to reproduce the same sample later.
  4. Press Generate sample to show results above the form.
  5. Use Download CSV or Download PDF for records.
Quality control notes

Random selection helps reduce bias in inspections. Keep the seed and settings with the lot record to support traceability during audits.

Practical role of random sampling in inspection

Random sampling supports defensible quality decisions by giving every unit in a lot the same chance of selection. When inspection resources are limited, a properly selected sample can reveal process shifts early and reduce the risk of missing localized defects. Consistency matters: record the population definition, the chosen sample size, and the generation time so your sampling plan is repeatable and reviewable.

Selecting sample size with risk in mind

Sample size is a business decision that balances inspection cost against the consequences of nonconforming product escaping. Higher criticality, unknown supplier capability, or recent process changes justify larger samples. For stable processes, smaller samples may be appropriate when combined with trending and corrective actions. Always keep n ≤ N, and avoid convenience patterns such as “first items off the line.”

Uniform selection without repeats

This calculator uses simple random sampling without replacement. Internally, it performs a partial Fisher-Yates shuffle: for each position i, it swaps with a uniformly selected index j from the remaining pool. Taking the first n values after these swaps produces a sample where each ID is equally likely and no ID can appear twice. Sorting the output only changes display order, not which units were selected.

Seeds and audit traceability

A seed provides controlled repeatability. If you enter the same seed with the same population definition and sample size, the generator will reproduce the same sample sequence, which is valuable for audits, investigations, and cross-team reviews. If you leave the seed blank, the tool uses an automatic seed for day-to-day randomness. Store the seed and parameters with the lot record to preserve the decision trail.

Operational workflows and exports

Exported sample lists reduce manual transcription errors and speed up execution on the shop floor. Use the CSV output for spreadsheet checklists and barcoded traveler documents, and use the PDF output for controlled records and supplier communications. For non-numeric identifiers, the list mode supports mixed formats and removes duplicates before sampling. Combine random selection with clear acceptance criteria, defect classification, and documented disposition steps.

FAQs
1) What does “without replacement” mean?

Each selected ID is removed from the pool, so it cannot be chosen again. This prevents duplicates and keeps the sample truly unique.

2) When should I use the seed field?

Use a seed when you need repeatable results for audits, investigations, or approvals. The same seed with identical inputs recreates the same sample.

3) Can I sample alphanumeric part IDs?

Yes. Switch to list mode and paste IDs separated by lines or commas. The tool removes duplicates and then samples from the unique set.

4) Why would I sort the output?

Sorting makes the list easier to locate in bins or racks, but it does not change which IDs were selected. It only changes display order.

5) What if my sample size is larger than the population?

The calculator blocks the request. Reduce the sample size or expand the population definition, because you cannot pick more unique items than exist.

6) How should I document sampling for compliance?

Save the population definition, sample size, seed used, date/time, and exported list. Pair it with acceptance criteria and inspection outcomes for traceability.

Related Calculators

AQL Sample SizeAcceptance Sampling PlanLot Size CalculatorInspection Level SelectorSampling Plan FinderDouble Sampling PlanSwitching Rules ToolInspection Severity SelectorAQL Lookup TableNormal Inspection Plan

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.