Text Repeater

Repeat a string or block of text a specified number of times with an optional separator.

About This Tool

You need 'lorem ipsum lorem ipsum lorem ipsum' fifty times for a layout test, or a CSV with the same row repeated 100 times for load testing. Type the string, set the count, optionally add a separator, and copy the output.

The separator handles the common cases — newline, comma, custom string — so you don't have to manually concatenate after the fact. Empty string for 'just smush them together,' newline for one-per-line text dumps, comma for inline lists.

Large counts are handled, but past a few hundred thousand repetitions the browser will get sluggish loading the result into the textarea. For truly large outputs, generate in chunks or use a server-side tool.

The implementation is genuinely simple: take the input string, multiply by the count, optionally interleave a separator. JavaScript's `String.prototype.repeat()` does the heavy lifting natively. For a 50-character string repeated 10,000 times with newline separators, the output is around 510 KB — large but trivially manageable. Past a few million repetitions, browser memory pressure becomes noticeable, and rendering the result in the textarea slows perceptibly.

Use cases that show up most: lorem ipsum filler for layout testing (when you need to see how a UI handles long text), CSV row duplication for load testing import paths, repeated test fixtures for parser stress tests, and the occasional 'I need to type this exact phrase 200 times' annoying task. The separator option handles the difference between 'one giant string' (no separator) and 'one entry per line' (newline separator), which most consumers of repeated text need.

A worked example: testing a CSV import that's supposed to handle thousands of rows. You take a known-good row — say, `"John Doe","john@example.com","Active","2026-01-15"` — set the count to 10,000, and pick a newline separator. The output is a 10,000-row CSV ready to upload. If your import handles it, good. If it crashes at row 7,532 with a memory error, you've found a bug. If it reorders rows because you have no unique ID column, you've found a different bug. Either way, generating the test data took 10 seconds rather than 10 minutes of fiddling with a script.

A small caution: be careful with separators that contain characters meaningful to the consumer. If you're generating test JSON and use a comma separator, the result might be syntactically invalid JSON if the input itself contained commas. The repeater is dumb — it doesn't escape, parse, or validate. For test data that needs to be valid in a specific format, generate the format-aware version yourself or use a tool that knows the format. The repeater is for raw text duplication; structural validity is your problem.

For genuinely large outputs (hundreds of millions of repetitions), the browser is the wrong tool. A two-line shell command (`yes "input string" | head -n 500000000`) handles arbitrary scale because shells stream rather than buffering everything in memory. The repeater is the convenient option for reasonable counts; it's not where you go for truly massive output.

The about text and FAQ on this page were drafted with AI assistance and reviewed by a member of the Coherence Daddy team before publishing. See our Content Policy for editorial standards.

Frequently Asked Questions