Skip to content

Add Prefix

Put the same text at the start of every line.

Use {n} to insert the line number.

Quick Tool Overview

Add Prefix puts the same text at the start of every line in a list — a domain in front of paths, a hyphen to make Markdown bullets, a comment marker in front of code. Blank lines are skipped and existing indentation can be preserved.

What it does
Adds text to the start of every line
You give it
A list, one item per line
You get back
The list with your prefix on every line
Best for
Prepending domains, markers, codes and bullets
Text Tools Free, unlimited use No sign-up Runs in your browser

About the Add Prefix

Adding the same thing to the front of every line is one of the most common list operations there is. A domain in front of a list of paths. A hyphen in front of a list of items to make it Markdown. A comment marker in front of a block of code. A country code in front of a column of phone numbers.

Doing it by hand means clicking to the start of each line and typing, which is fine for five lines and unbearable for five hundred. This does the whole list at once. Blank lines can be skipped, existing indentation can be preserved so the prefix goes after it rather than before, and a {n} placeholder is replaced with the line number for numbered output.

Key features of the Add Prefix

Indentation preserved

Place the prefix after existing whitespace so nested structure survives — what commenting out indented code needs.

Blank lines skipped

No line consisting only of the prefix, unless you explicitly want every line treated the same.

The {n} placeholder

Insert the line number in the prefix for quick numbered output.

Whole list at once

Five hundred lines take the same single action as five.

Download the result

Save the prefixed list straight to a file rather than copying it in pieces.

How to use the Add Prefix

  1. 1

    Paste your list

    One item per line — paths, names, numbers or code.

  2. 2

    Type the prefix

    The text to add at the start of every line. Use {n} to insert the line number.

  3. 3

    Handle indentation

    Place the prefix at the very start, or after any existing indentation so nested structure survives.

  4. 4

    Copy the result

    Copy or download the prefixed list.

Frequently asked questions

Not by default. Blank lines are skipped, since a line containing only the prefix is almost never intended. There is a switch to include them when you need every line treated the same.

Reviews of the Add Prefix

What people who use the Add Prefix think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the Add Prefix. It takes half a minute and no account.

Write the first review

More text tools