Repeat any text or character N times

Repeat one complete text unit from 1 to 1,000 times with an optional separator between copies.

freeworks offlinenothing uploaded
ToolCharacter Repeater
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

An array of the requested size is filled with the complete source string and joined by the separator. Joining inserts exactly one separator between neighboring copies, so N repetitions contain N − 1 separators.

  • Three copies and no separator produce a short pattern without adding unrequested characters.
  • The 1,000-copy ceiling bounds browser memory use from an accidental large value.

Worked example

Create a 40-character divider line
Repeat a dash character 40 times to create a horizontal rule for text files
Input
											Input: -
Count: 40
Separator: 
										
Output
												----------------------------------------
											

When to use this

Plain-text dividers use repeated dashes, boundary tests create known-length runs, and lyric drafts repeat a syllable with spaces.

Edge cases

  • NA repeats as the unit NA rather than repeating N and A independently.
  • Five copies with commas contain four commas and no trailing comma.
  • An empty source and a count above 1,000 are rejected before output is allocated.

References