Repeat Text Generator
Repeat text with separators and numbering.
100% client-side processing
Repetitions: 0 | Total chars: 0 | Original chars: 0
Repeat Text duplicates a string a chosen number of times and joins the copies with a separator you control. It is a small utility with a precise job: generate filler rows, separator lines, numbered lists, and test payloads without writing a loop or opening a script editor. The input, options, preview, and copy button all live in one panel, and nothing is sent to a server.
The Three Controls
The first control is the source text: anything you type or paste into the left box is treated as one unit. The second is the repeat count, a number input bounded from 1 to 10,000. The third is the separator, a dropdown offering newline, comma, space, tab, and a Custom entry that reveals a second text field when selected. A checkbox toggles line numbering. Every change recalculates the preview immediately, and a Copy button places the whole output on the clipboard using the Clipboard API with a legacy fallback.
How the Output String Is Built
The tool builds an array of copies, optionally prefixes each one with its position number plus a period and a space, then joins the array with the separator. Because join only inserts the separator between elements, the count of separators is one less than the count of copies. The reported totals follow directly: total characters equal the sum of the copy lengths, plus the separators, plus any numbering prefixes, while the original character count is just the source text length. This is why the output size is not simply the source length multiplied by the count.
Worked Example: Same Text, Five Separators
Take the two-character source ab and repeat it three times:
| Separator | Numbering | Output | Total chars |
|---|---|---|---|
| Newline | off | ab, ab, ab on three lines | 8 |
| Newline | on | 1. ab, 2. ab, 3. ab | 17 |
| Comma + space | off | ab, ab, ab | 10 |
| None (empty custom) | off | ababab | 6 |
| Space-dash-space | off | ab -- ab -- ab | 12 |
The unnumbered newline case is the arithmetic to remember: three copies at two characters each is six, plus two newline separators, equals eight. Turning on numbering adds three three-character prefixes, which is nine more, for a total of seventeen.
Choosing the Right Separator
Newline is the default for anything list-shaped: SQL value lists, log fixtures, and mock rows. Comma suits quick inline enumeration, while tab is the right choice when pasting into a spreadsheet or building a delimited fixture. A space is useful for generating padding such as repeated underscores. The custom field covers everything else, including decorative rules: source a single = with a count of 60 and an empty separator to draw a horizontal line, or use | to build a readable pipe-separated sequence.
Think about the parser on the receiving end before you pick. A list pasted into a spreadsheet needs a tab or comma so each copy lands in its own cell; a list pasted into a document reads better with a newline. If the source already contains the separator character — a comma inside an address, for instance — choose a different separator or quote the source, because the tool does not escape anything. The Copy button copies exactly what the preview shows, including whitespace, so inspect the preview whenever the separator is a single space or an empty string.
Size and Performance Limits
The hard ceiling is 10,000 repetitions. A warning appears for counts above 1,000 because the output is generated as one string and placed in a single text area. Ten thousand copies of a one-character source with newline separators is 19,999 characters, which is trivial. The same count applied to a 200-character line approaches two million characters, which can stutter the preview and slow clipboard writes. If a large paste feels sluggish, lower the count, shorten the source, or copy the output in sections.
Practical Recipes and Limitations
Generate a numbered checklist by repeating - [ ] Task with newline separators and numbering off, then fill in the items. Create a CSV header gap by repeating an empty marker with comma separators. Build a batch of unique-looking test records by repeating a placeholder such as user@example.com on separate lines. Draw section breaks with a repeated character and no separator. In each case, the preview confirms the exact character total before you copy, which is useful when a downstream field has a length limit.
One habit saves rework: copy the output into a scratch buffer before pasting it somewhere permanent. A repeat count that looked reasonable in the preview can be obviously wrong once it sits among real content, and undoing a large paste is quicker than regenerating it.
The tool is also not a template engine. It cannot substitute variables, increment numbers inside the text, alternate between several values, or randomize output. The numbering option is the only built-in variation, and it always counts from 1 upward with no zero padding, so copy 9 begins with 9. and copy 10 with 10. . It does not wrap or truncate at a maximum output length, and it does not validate that the result is well-formed CSV, SQL, or JSON — malformed source stays malformed however many times you repeat it. For patterns that need variables, sequences, or randomness, use a scripting language or a dedicated generator instead.
Related Tools
Frequently Asked Questions
What happens if I type 0 or leave the repeat count blank?
The interface treats a blank field or a parsed value of 0 as 1, so you always get at least one copy. Negative values are the exception: they fall outside the number input's minimum of 1 and produce an empty result when typed manually. The library itself returns empty output for a count of 0, which is why the interface substitutes 1.
Is the separator placed before the first copy or after the last?
Only between copies. Joining three items with a newline produces two newline characters, not three, so the output never starts or ends with a stray separator. With a custom separator left empty, the copies are concatenated with nothing between them.
Does the numbering option change the total character count?
Yes. Numbering prepends a one-based prefix such as "1. " or "12. " to each copy before the separator is inserted, so the prefix characters are added to the output. Repeating a two-character string three times with numbering is 17 characters, versus 8 without.
Can the custom separator be more than one character?
Yes. The custom field accepts any text, including spaces, pipes, dashes, or a full phrase. Whatever you type is inserted verbatim between copies. A common choice is a pipe surrounded by spaces, which reads well in plain-text lists.
Why is the output truncated or slow at very high counts?
The repeat count is capped at 10,000, and a warning banner appears above 1,000. The entire result is held in a single text area, so a long source line multiplied thousands of times can consume several megabytes and make the browser pause while rendering or copying. Start smaller and increase the count until the preview stays responsive.
Can I repeat multiple different lines independently?
Each run repeats one input string. To alternate patterns, build them into the input text first, or run the tool once per block and join the results. There is no per-line mode that cycles through a list of distinct values.
Reviewed by the HandyTools Hub team · Last updated