Duplicate Lines

Duplicate each non-empty line in your text a specified number of times. Useful for formatting, code, or preparing text for specific applications.

Results

Waiting for your input...

Instructions

  1. Paste or type your text into the input box. Each line will be processed.
  2. Example: Line 1\n\nLine 2\n\n\nLine 3
  3. Enter the number of times you want each non-empty line to be duplicated (e.g. 3).
  4. Click Convert to see your text with each line duplicated the specified number of times.
  5. Example output (with 3 times): Line 1\nLine 1\nLine 1\nLine 2\nLine 2\nLine 2\nLine 3\nLine 3\nLine 3
  6. All empty lines in your input will be ignored.

Frequently Asked Questions (FAQs)

What happens to empty lines in my input?

All empty lines are ignored. Only non-empty lines are kept and duplicated as specified.

Can I duplicate lines more than once?

Yes, you can duplicate each line as many times as you want.

What if I enter a negative or zero value for times?

The tool will treat zero or negative values as one, so each line will appear once.

Will the tool work with very large texts?

Yes, the tool is designed to handle large multi-line text inputs efficiently.

API Usage

API Usage

This tool provides an API for programmatic access.

Endpoint: POST /tools/duplicate-lines/api/

Request Body: { "text": "Line 1\n\nLine 2\n\n\nLine 3", "times": 3 }

Response: The response will be the processed text with each non-empty line duplicated the specified number of times. { "result": "Line 1\nLine 1\nLine 1\nLine 2\nLine 2\nLine 2\nLine 3\nLine 3\nLine 3" }