About the Add Prefix and Suffix to Lines tool
Turning a column of words into SQL values, adding a hashtag to every keyword, wrapping each line in quotes or putting a bullet in front of every item takes seconds here. This tool lets you add prefix text to the start of every line and suffix text to the end, number the lines as it goes and skip blank lines so empty rows stay empty. It saves a great deal of manual editing when a list runs to hundreds of lines. For joining a list into one comma-separated line, use the Comma Separator, and to number lines with more control, try Add Line Numbers.
Most jobs here are mechanical. Wrap every line in quotes with a trailing comma and a column of names is ready to drop into code or a database query. Place your domain before each path and a list of slugs turns into complete links. Start each line with a dash and plain text becomes a Markdown list.
Numbering is built in. You pick the first number, the amount of zero padding and the separator that follows, so a list can run from 01. to 99. without any manual counting. One option skips empty lines so the sequence never breaks. A separate switch trims spaces from both ends of every line first, useful when the list came out of a spreadsheet with hidden spaces.
A summary reports how many lines were changed, so you can confirm that every item was handled before copying or downloading the result.
How to use the Add Prefix and Suffix to Lines tool
- Paste the listPut one item on each line of the input box.
- Type a prefix, a suffix or bothEither box can stay empty if you only need one.
- Set up numbering if wantedPick a starting number, zero padding and the separator after each number.
- Apply and copyThe rewritten lines appear underneath, ready to copy or download.
Add Prefix and Suffix to Lines features
- Text added to the start, the end or both ends of every line
- Optional numbering from any starting value
- Zero padding so numbers stay aligned
- Choice to skip or keep blank lines
- Trimming of spaces before each line is wrapped
- Count of lines that were changed
- Copy and download buttons for the result
Common uses
- Turning a column of values into a SQL IN list or code array
- Building full links from a list of page paths
- Converting plain lines into Markdown bullets or a numbered list
- Quoting every item for a CSV row
- Numbering a set of steps or quiz questions
Adding prefixes and suffixes to every line: fast list formatting
Turning a plain list into something usable often means adding the same text to the start or end of every line: quotes around values, commas at the end, bullet symbols, URLs around IDs, or HTML tags around items. Doing it by hand for a long list is tedious and error-prone. This guide shows the most useful prefix and suffix patterns and how to combine them with other list tools.
How it works
You give a prefix, a suffix or both, and the tool adds them to each line. Options typically include skipping blank lines, so empty lines stay empty, and numbering lines, so each line can start with its position in the list.
Common patterns
| Goal | Prefix | Suffix | Example result |
|---|---|---|---|
| Quote values for SQL or code | ' | ', | 'apple', |
| Bullet list | - | none | - apple |
| Full URLs from slugs | https://example.com/ | / | https://example.com/apple/ |
| HTML list items | <li> | </li> | <li>apple</li> |
| Hashtags | # | none | #apple |
| CSV with quotes | " | ", | "apple", |
Preparing lists for code
Developers often receive values as a column in a spreadsheet and need them as an array or SQL list. Adding a quote prefix and a ', suffix to each line, then removing the comma from the last line, produces a ready-to-paste list. For quick conversion between lines and comma-separated text, Comma Separator does the joining and quoting in one step.
Building links in bulk
If you have a list of page slugs, product IDs or usernames, adding a URL prefix turns them into full links. Adding a closing slash or a query string as a suffix completes them. For clickable HTML links with anchor text, Bulk Link Generator creates complete anchor tags.
Numbered lines
Numbering lines while adding prefixes creates ordered lists, ranked results or numbered questions. For more control over number format, starting value and padding, Add Line Numbers is designed specifically for numbering.
Skipping blank lines
When a list has blank lines separating groups, adding a prefix to every line would put a lonely bullet or quote on each empty line. Skipping blank lines keeps the grouping clean. If you want no blank lines at all, remove them first with Text Cleaner.
A worked example: hashtags for a post
A social media manager has a list of 12 keywords, one per line, some with spaces, such as "summer sale". Hashtags cannot contain spaces, so first remove spaces with find and replace, giving "summersale". Then add a # prefix to every line, giving "#summersale". Finally, join the lines with spaces using Comma Separator set to a space delimiter, and paste the result into the post. The whole job takes under a minute.
Watch out for special characters
If the items themselves contain quotes or commas, wrapping them in quotes can break CSV or code. In CSV, quotes inside values are escaped by doubling them. In code, they may need a backslash. Check a few lines with unusual content before using the result.
Common mistakes
- Forgetting to remove the trailing comma from the last item in a code list.
- Adding a prefix to blank lines and creating empty entries.
- Not trimming spaces, so prefixes attach to lines with leading spaces.
Preparing data for spreadsheets and imports
Many imports expect values in a particular shape: phone numbers with a country code, product codes with a supplier prefix, or file names with an extension. Adding the missing part to every line in one step is much faster than editing cells one by one. For example, adding the prefix +92 to a column of local mobile numbers, after removing their leading zero, gives numbers in international format ready for a messaging tool.
Wrapping lines in HTML or Markdown
Writers who publish online can turn plain lists into formatted lists quickly. Adding - at the start of each line makes a Markdown bullet list; adding <li> and </li> makes HTML list items, which you then wrap in <ul> tags. For whole documents, Text to HTML Converter converts paragraphs, lists and links automatically.
Checking the result
After adding prefixes and suffixes, scan the first, last and a few middle lines. Look for double spaces where the original lines had leading or trailing spaces, missing text on lines that were blank, and the last line's trailing comma or separator. Small issues are easy to fix in a list of ten lines and very annoying to discover after importing ten thousand.
Combining several steps
Complex reformatting often takes a few passes: clean the lines, sort them, remove duplicates, then add prefixes and suffixes. Doing the steps in that order prevents duplicates with different wrappers and keeps the final list tidy and predictable.
Prefixes for file and folder names
When renaming many files with a script or a batch renaming tool, a list of old names with a date prefix, such as 2026-10-, gives consistent new names that sort chronologically. Generate the new names here, then paste them into the renaming tool.
Privacy
Formatting happens in your browser. Lists of emails, IDs and customer data are never uploaded.
Frequently asked questions
How do I put quotes and a comma around every line?
Enter a double quote as the prefix and a double quote plus a comma as the suffix. Each item then comes out wrapped and separated, ready for an array in code or a value list in a database query.
Why would I pad numbers with zeros?
Padding gives every number the same width, so 1 becomes 01 or 001. Numbers padded this way sort in the right order even when treated as plain text, a trick widely used in file names and product codes.
Do empty lines get a number?
Only when you choose to keep them. If you skip them, the count continues unbroken and the empty rows are left exactly as they were, so the layout of your list is preserved.
Will trimming alter my text?
Only at the edges. Leading and trailing spaces or tabs are stripped from every line, but nothing between the first and last visible character is touched. Turn it on for lists copied from spreadsheets, which often hide extra spaces you cannot see.
Can this tool remove a prefix?
No, it only adds text. Taking a repeated opening string off every line is a replacement task, so use Find and Replace Text and leave the replacement box empty.
Is there a maximum number of lines?
No. Everything runs inside your browser, so lists with many thousands of lines are processed almost instantly, and because nothing is uploaded, the contents stay private.