Random Line Picker
Pick a random line from text.
About this tool
Put one option on each line and press Pick one. The tool chooses a single line at random and shows it large, with a short history of earlier picks.
How to use
How it works
Blank lines are ignored and each remaining line has the same chance. The index is drawn from crypto.getRandomValues, the browser's cryptographic random source, and a short spin animation plays before the result settles. A line can be picked more than once across presses.
Worked example
Lunch options
- Input
- Oranges Apples Bananas Cherries Mangoes
- Output
- One of the five lines, each with a 1 in 5 chance
- Walkthrough
- Five non-empty lines means every line has a probability of 0.2 on each press.
Limitations
- Picks with replacement: the same line can come up twice in a row.
- Duplicated lines get proportionally more chances.
- Picks one line at a time.
Questions
How do I pick a random line from a list?
Is it truly random?
Can the same line be picked twice?
Features
- Cryptographic random source
- Pick history
- Runs in your browser
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
Learn Regular Expressions - Crash Course
freeCodeCamp.org
Regex powers many find/replace and clean-text workflows.
Watch on YouTubeRegular Expressions in 100 Seconds
Fireship
Fast regex refresher for text extraction patterns.
Watch on YouTube
- Unicode Normalization Forms
Unicode
Why seemingly identical characters break equality checks.
- RFC 3629 — UTF-8
IETF
UTF-8 rules behind character-counting tools.