# Array Random Sampler

Randomly select specified number of elements from an array with support for different sampling methods

> Canonical page: https://elysiatools.com/en/tools/array-random-sampler

- **Category:** Development

- **Keywords:** array, random, sample, select, pick, choose, sampling, shuffle

## Overview

The Array Random Sampler is a versatile utility designed to extract a specific number of elements from any dataset using various statistical sampling methods, ensuring precise and reproducible results for your data processing tasks.

## Inputs

- **Array Elements** (textarea): Enter array elements separated by delimiter... apple, banana, orange, grape, mango, peach, kiwi, pineapple
- **Input Delimiter** (select)
- **Custom Delimiter** (text): Enter custom delimiter
- **Sample Size** (number): Number of elements to sample (e.g., 3)
- **Sampling Method** (select)
- **Random Seed** (number): Seed for reproducible results (optional)
- **Allow Duplicates (Sampling with Replacement)** (checkbox)
- **Preserve Original Order** (checkbox)
- **Output Format** (select)

## When to use

- When you need to select a representative subset from a large list of items for testing or analysis.
- When you require reproducible random selections for experiments by utilizing a specific random seed.
- When you need to perform specialized sampling, such as systematic or simple random selection, on raw data inputs.

## How it works

- Paste your data into the input field and select the appropriate delimiter that matches your data format.
- Define the number of elements you wish to extract and choose your preferred sampling method.
- Configure optional settings like random seeds for reproducibility or replacement options to allow duplicate selections.
- Select your desired output format, such as JSON, CSV, or a formatted table, to generate the final sampled list.

## Use cases

- Generating random test data for software development and QA automation.
- Selecting a random subset of participants from a database for survey or research purposes.
- Creating randomized variations of content lists for A/B testing marketing campaigns.

## Frequently asked questions

### Can I ensure the same random result every time?

Yes, by entering a specific number in the 'Random Seed' field, you can generate the same sequence of random selections repeatedly.

### What is the difference between simple and systematic sampling?

Simple random sampling selects items purely by chance, while systematic sampling selects items at regular intervals from the original list.

### Does this tool support custom delimiters?

Yes, select 'Custom' from the delimiter dropdown and enter your specific character in the 'Custom Delimiter' field.

### Can I pick the same item more than once?

Yes, enable the 'Allow Duplicates' option to perform sampling with replacement, which allows the same element to be selected multiple times.

### What output formats are available?

You can export your results as a formatted table, JSON, CSV, visual representation, statistics summary, or a simple text list.

## Related tools

- [Array Element Deleter](https://elysiatools.com/en/tools/array-element-deleter): Delete specific elements from arrays with support for multiple deletion methods
- [Array Element Replacer](https://elysiatools.com/en/tools/array-element-replacer): Replace specific elements in arrays with support for multiple replacement methods
- [Array Slicer](https://elysiatools.com/en/tools/array-slicer): Extract specific portions from arrays with support for various slicing methods and flexible range selection
- [Data Column Extractor](https://elysiatools.com/en/tools/data-column-extractor): Extract specific columns from tabular data with support for various formats and flexible column selection
- [Absolute Neutrophil Count (ANC) Calculator](https://elysiatools.com/en/tools/absolute-neutrophil-count): Calculate the Absolute Neutrophil Count (ANC) = WBC × (segmented % + band %) / 100. Unit selectable: cells/µL or ×10⁹/L (1 ×10⁹/L = 1000 cells/µL). Adult reference ≥ 1500 cells/µL. Neutropenia risk strata: mild 1000–1500, moderate 500–1000, severe < 500 (agranulocytosis < 200) — high risk of serious infection, and febrile neutropenia is a medical emergency. Clinical uses: chemotherapy cycles typically require ANC ≥ 1500 to proceed and ≥ 500 for discharge from protective isolation; carbimazole/clozapine monitoring; congenital neutropenia workup. Neutrophilia > 7500 suggests bacterial infection, inflammation, steroids, or a myeloproliferative neoplasm. If only segmented % is reported, set band % to 0; if the instrument reports an absolute neutrophil count directly (NE#), this tool is not needed. Based on ASCO/IDSA neutropenia guidance, Boxer ASH 2012, and MDCalc. Not medical advice.
- [AHU Coil Capacity Calculator (Cooling / Heating)](https://elysiatools.com/en/tools/ahu-capacity-calculator): Compute the total, sensible, and latent capacity of an air-handling-unit (AHU) coil from the entering/leaving air state and the dry-air mass flow ṁ_da. Total capacity Qt = ṁ_da·(h1 − h2); sensible capacity Qs = ṁ_da·cp_ma·(T1 − T2) with cp_ma ≈ 1.006 + 1.86·W \[kJ/(kg da·K)\]; latent capacity Ql = Qt − Qs; Sensible Heat Ratio SHR = Qs / Qt. Each state is described by dry-bulb T plus one humidity input (relative humidity φ, or humidity ratio W); W is derived from the Magnus saturation fit when RH is supplied, and enthalpy h = 1.006·T + W·(2501 + 1.86·T) \[kJ/kg da\]. Signed result — works for cooling or heating coils.
- [Array Element Counter](https://elysiatools.com/en/tools/array-element-counter): Count occurrences of specific elements in arrays with support for multiple counting modes and statistical analysis
- [Array Reverser](https://elysiatools.com/en/tools/array-reverser): Reverse the order of array elements with support for various input formats

## Samples

- [Regex Replace Samples](https://elysiatools.com/en/samples/regex-replace): Collection of common and useful regex replacement patterns for text transformation and data cleaning
- [PDF Samples](https://elysiatools.com/en/samples/pdf-samples): Generated PDF samples from tools dated 2026-02-01 to 2026-02-10
- [Test Pyramid Examples - Testing Strategy Guide](https://elysiatools.com/en/samples/test-pyramid-examples): Comprehensive test pyramid implementation examples including unit tests, integration tests, E2E tests, test organization, and strategic testing patterns for balanced software quality assurance
- [Markdown Viewer Samples](https://elysiatools.com/en/samples/markdown-viewer-samples): Sample Markdown files for README preview, documentation rendering, and rich-text markup tests
