0 lines
0 lines

About the Add Prefix/Suffix to Each Line Tool

What does this tool do?

It bolts the same text onto every line of a list in one go. Type something in the Prefix box and it lands at the start of each line; type in the Suffix box and it lands at the end. Paste a column of slugs and add https://example.com/ in front to get full URLs, or wrap every line in an HTML tag — the output updates as you type, with no button to press.

There's a built-in line-numbering option too, so you can turn a plain list into a numbered one in a few different styles, starting from whatever number you choose. Helpers to trim stray whitespace and skip blank lines keep the result clean. Everything happens in your browser, so even a long list stays private and the result is instant.

How to Use This Tool

  1. Paste your lines. Drop your list into the left box, drag in a .txt file, or hit Sample to see it work.
  2. Type a prefix and/or suffix. Whatever you enter is added to the start and end of every line.
  3. Number the lines (optional). Pick a numbering style and a starting number to prepend 1., 1), or a zero-padded count.
  4. Tidy up. Keep Skip empty lines and Trim each line on for a clean result, or turn them off to preserve your text exactly.
  5. Take the result. The modified list appears live on the right — copy it or download it as a text file.

Common Use Cases

Adding the same text to many lines is a job that comes up all the time:

  • Building full URLs: Add a domain prefix to a column of page paths or slugs.
  • Wrapping lines in HTML: Put <li> before and </li> after each item to build a list.
  • Formatting for code: Add a comment marker, a bullet, or an indent to every line at once.
  • Numbering a list: Turn steps or items into a clean numbered list with your chosen style.
  • Tagging data: Append a unit, a status, or a category to each value before importing it.

Want to wrap each line in quotes for code or SQL? Use our Wrap Each Line in Quotes tool, or browse all our free text tools.

Frequently Asked Questions

What's the difference between a prefix and a suffix?

A prefix is text added to the start of each line and a suffix is text added to the end. For the line "item", a prefix of "start_" and a suffix of "_end" produce "start_item_end". You can use one, the other, or both at the same time.

Can I add a number to each line?

Yes. Choose a numbering style — "1.", "1)", "1 -", or a zero-padded "01." — and the tool prepends a running number to each line. You can set the starting number, and the number is added before your prefix, so you keep full control over the layout.

Does it add the text to blank lines too?

Only if you want it to. With Skip empty lines on (the default), blank lines are left untouched so they keep working as spacers. Turn it off and the prefix, suffix, and numbering are applied to every line, blanks included.

What does "Trim each line" do?

It removes any stray spaces or tabs from the start and end of each line before the prefix and suffix are added. That stops you from ending up with odd gaps like "https://example.com/ about-us" when a pasted line had a leading space.

Is my data private?

Completely. All processing runs locally in your browser with JavaScript — nothing you paste is uploaded, stored, or logged, and the tool keeps working offline once the page has loaded.