Text tool

Extract Random Lines

Paste text, choose how many lines to extract, and review a local random sample.

In-browser processingNo account requiredPrivacy details ↗

Up to 100,000 characters and 10,000 lines. Blank lines count; selected line text is preserved.

Paste text to begin.

A QUICK WALKTHROUGH

How to use this tool

  1. Paste up to 100,000 characters of plain text.
  2. Choose a whole number from 1 through the number of input lines.
  3. Extract the lines and review or copy the result.

Without replacement

Each run selects distinct input positions. Repeated line text can still appear more than once when it occurs on multiple input lines.

Bounded local input

The count must be a whole number from 1 through the number of input lines. Input is limited to 100,000 characters and 10,000 lines; blank lines count and selected line text is preserved.

Browser-only cryptographic randomness

Selection uses crypto.getRandomValues with rejection sampling to avoid modulo bias. Text is processed in this browser and is not uploaded or stored.

GOOD TO KNOW

Common questions

Can the same line be selected twice?

No. Selection is without replacement. Identical text on separate input lines remains eligible separately.

What happens when the requested count exceeds the input lines?

The tool reports an error and does not produce a partial result.

Are blank lines preserved?

Blank lines count as input lines and can be selected; selected line text is returned as-is.