Add Prefix and Suffix to Lines

A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call

Add text to the start and end of every line at once: bullets, quotes, commas, HTML tags or line numbers. Skip blank lines, join into one line, then copy.

Lines changed
0
Result

Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.

How to add a prefix and suffix to every line

  1. Paste your lines, one item per line: names, product codes, URLs, keywords, email addresses, anything.
  2. Type the prefix, the text to add before each line, such as - for a bullet or " for a quote.
  3. Type the suffix, the text to add after each line, such as , or ".
  4. Choose the options: skip blank lines, trim spaces from each line first, and whether to keep one item per line or join everything into one line with commas or spaces.
  5. Copy the result.

To number lines, put {n} in the prefix or suffix: {n}. gives "1. ", "2. ", "3. " and so on. The tool shows how many lines were changed.

It's a small task, but doing it by hand for 200 lines is slow and error-prone. Here you add prefix and suffix text to every line at once, and nothing you paste leaves your browser.

Ready-made recipes

You want Prefix Suffix Output
A bulleted Markdown list - - Seeded rye
A numbered list {n}. 1. Seeded rye
Quoted values for code or SQL ' ', 'Seeded rye',
A JSON array of strings " ", "Seeded rye",
HTML list items <li> </li> <li>Seeded rye</li>
Hashtags # #sourdough
Full URLs from paths https://crumbco.com/ https://crumbco.com/menu
Email addresses from usernames @crumbco.com [email protected]
A comma-separated list choose "Join with commas"

Quoting values for SQL, code and spreadsheets

A very common use is turning a column of IDs or names into a list for code. For an SQL query, paste the IDs, set the prefix to ' and the suffix to ', and choose "Join with commas". You get 'A12', 'B07', 'C33', ready to drop into WHERE code IN ( โ€ฆ ).

For JSON or JavaScript, use " around each line and join with commas, then wrap the result in [ ]. If any line contains a quote itself, check it afterwards: this tool adds text, it doesn't escape quotes inside your lines. For values that need proper escaping, the JSON formatter will tell you whether the result is valid.

Lists for social posts, docs and emails

When you add prefix and suffix text to a list of features or menu items, it's easy to make it look intentional on every platform:

  • Emoji bullets for Instagram, LinkedIn or a newsletter: prefix ๐Ÿž or โœ… .
  • Markdown bullets for GitHub, Notion or documentation: prefix - .
  • Numbered steps for a how-to: prefix {n}. , starting at 1.
  • Hashtags from a list of keywords: prefix #, then join with spaces.

Combine it with other tools for more complex jobs: sort lines alphabetically first, remove duplicate lines, or remove line breaks to get rid of stray empty lines. If you need the same text repeated rather than different lines decorated, the text repeater does that.

Line numbers with {n}

The {n} placeholder is replaced by the line's number. A few things to know:

  • Numbering starts at 1.
  • With "Skip blank lines" on, blank lines are left as they are and don't get a number, so the numbering stays continuous: 1, 2, 3 even with gaps between.
  • You can use {n} in both the prefix and the suffix, and more than once. A prefix of <li id="item-{n}"> with a suffix of </li> makes numbered HTML list items.
  • To pad numbers, such as 001, 002, use a spreadsheet instead; this tool writes plain numbers.

Trim and skip blank lines

Text copied from spreadsheets, PDFs and websites often has stray spaces at the start or end of lines, and blank lines between them. "Trim spaces first" removes the spaces at both ends of each line before the prefix and suffix are added, so you don't get - Seeded rye . "Skip blank lines" leaves empty lines untouched instead of turning them into a lone bullet or a pair of quotes.

When you join lines with commas or spaces, blank lines are dropped entirely, so the result has no empty items.

Doing the same in other tools

If you work in a spreadsheet, you can do the same with a formula: ="- "&A1&";" in Excel or Google Sheets, then copy the column. In code editors such as VS Code, multi-cursor editing (Alt+Shift+I after selecting lines) lets you type at the start and end of many lines at once. Both work, but for a quick job on any device, pasting here is faster, and it doesn't change your original file.

The same job comes up in data cleanup too. If a supplier sends a list of product codes and your system needs them with a prefix, such as CR-1042 instead of 1042, you can add prefix text to every code in one go and paste the result straight back into the spreadsheet column.

Privacy

Lists often contain email addresses, customer names or internal codes. This tool processes everything in your browser and doesn't store or send what you paste, so it's safe for private data.

When to add prefix and suffix text in bulk

You'll reach for this whenever the same text needs to wrap many items:

  • Marketing: turning a keyword list into hashtags, or a list of features into emoji bullets for a post.
  • Development: wrapping IDs in quotes for a query, building array literals, or turning paths into full URLs.
  • Data cleanup: adding a country code to phone numbers, a domain to usernames, or a prefix to product codes.
  • Writing: numbering steps, turning notes into a Markdown list, or adding a closing punctuation mark to each line.

In each case you add prefix and suffix text once, and the tool applies it to every line in the same way, so nothing is missed and nothing is typed twice.

Checking the result

Before you paste the result somewhere important, such as a database query or a live web page, glance at the first and last few lines. Look for lines that already had the prefix (you might end up with two), lines with stray spaces inside, and items that themselves contain quotes or commas, which can break code or CSV. Ticking "Trim spaces first" fixes most spacing problems. If you need to add prefix and suffix text again with different settings, just change the boxes: the result updates instantly from your original lines, which are never changed.

Privacy and speed

Because everything runs in your browser, you can add prefix and suffix text to thousands of lines at once without waiting for an upload, and the list never leaves your device.

Undo and try again

Your original lines are never changed. If the result isn't quite right, adjust the prefix, the suffix or the options and the output updates immediately. Copy it only when it looks exactly as you want.

A worked example

A bakery is launching a new menu, and the manager has a plain list of four new items from the head baker:

Seeded rye
Sourdough
Focaccia
Cinnamon buns

She needs it in three formats. First, for the Instagram caption: she types ๐Ÿž as the prefix, leaves the suffix empty, and keeps one item per line. The result is four neat emoji bullets, ready to paste.

Next, for the website's HTML menu: prefix <li>, suffix </li>, one per line. She pastes the result between <ul> and </ul> in the page.

Finally, the developer needs the names for a database query: prefix ', suffix ', joined with commas. The tool gives 'Seeded rye', 'Sourdough', 'Focaccia', 'Cinnamon buns'. Three formats from one list in under a minute, with no typos.

Need more customers from Google?

This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. That is the whole job of DeepRit: a PPC-only agency that sets up and runs Google Ads accounts so every click is accounted for. You keep full ownership of your account, get a written report every week, and can stop at any time. See our pricing or ask for a free audit.

Frequently asked questions

How do I add text to the beginning of every line?

Paste your lines, type the text in the Prefix box, and copy the result. Every line gets the prefix.

How do I add a comma to the end of every line?

Type , in the Suffix box. Or choose "Join with commas" to put everything on one line, separated by commas.

Can I number the lines?

Yes. Put {n} in the prefix or suffix, such as {n}. . It's replaced by each line's number, starting at 1.

How do I put quotes around each line?

Type " (or ') in both the prefix and suffix boxes. Choose "Join with commas" for a list ready for code or SQL.

Will blank lines get a prefix?

Not if "Skip blank lines" is ticked, which it is by default. They're left empty and don't take a number.

Is my text uploaded?

No. When you add prefix and suffix text here, everything happens in your browser.

Free PPC audit

See where your ad budget leaks.

We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.

Book a free audit call 30-minute call ยท Free ยท The audit is yours to keep