LazyTools – Header
Add Prefix Suffix Online — Bulk Prefix Adder, Add Text to Each Line | LazyTools.io

Add Prefix Suffix Online — Bulk Prefix Adder, Add Text to Each Line

Add prefix and suffix to text lines with 6 powerful modes: Per-line (standard), Per-word, Per-character, Wrap entire text, Alternating odd/even lines, and Template mode with {{LINE}} {{N}} {{UPPER}} {{LOWER}} placeholders. Includes rotating multi-pair cycles, conditional regex filter, 14 quote-wrap presets, Remove mode, and 4 export formats. 100% client-side.

6 Application Modes 🔒 100% Private Template Mode Rotating Pairs No Sign-Up
67K+monthly searches
6application modes

Prefix / Suffix Tool — Add Text to Each Line, Word, or Character

🔒 100% client-side
Application mode
Quick presets
" double quote " ' single quote ' ` backtick ` ( parens ) [ brackets ] { braces } < angle > « guillemets » – bullet * star <li> HTML </li> ' SQL ', ' 4-space indent // comment
Prefix (add before)
Suffix (add after)
Rotating prefix/suffix pairs — cycles through pairs line by line
1
2
Template pattern
Available placeholders: {{LINE}} = line content · {{N}} = line number · {{UPPER}} = line UPPERCASE · {{LOWER}} = line lowercase · {{TRIM}} = trimmed line
Remove prefix / suffix — strip existing text from each line
Remove from start:
Remove from end:
Tip: leave a field empty to skip removing from that end. The tool removes only if the line actually starts/ends with the given text.
Apply only when
spaces
Input text 0 lines
Output 0 lines
0Lines in
0Processed
0Skipped
0Chars added
0Output chars
4.9/5
5,284 ratings

Rate this tool

How useful was the Prefix/Suffix tool?

Add prefix and suffix to text in seconds

6 modes, 14 presets, rotating pairs, template mode, conditional filter, 4 export formats — all live.

1

Paste your text

Paste any text — keywords, URLs, code lines, names, items — one per line. Enable Live to see the result update instantly as you type. The stats panel shows line count and chars added immediately.

2

Choose a mode & preset

Select from 6 application modes. For standard bulk prefix/suffix, stay on Per Line. Pick a quick preset — double quotes, <li> tags, SQL quote, bullet, indent — or enter your own custom prefix and suffix. For dynamic output, switch to Template mode.

3

Fine-tune options

Enable Rotating pairs to cycle through multiple prefix/suffix pairs line by line. Use the Condition filter to apply only to matching lines. Set an Indent in spaces. Enable Trim to clean whitespace before wrapping, and Skip blank lines to preserve structure.

4

Export & copy

Switch between Plain text, HTML, JSON, and CSV export formats. Use Remove mode to strip existing prefixes/suffixes from already-processed text. Copy the output or Download as .txt.

Advertisement
728 × 90 — Leaderboard Ad

Frequently asked questions

Everything about adding prefix and suffix to text lines, words, and characters.

Per Line (default) applies the prefix and suffix to each entire line as a unit. For input hello world with prefix " and suffix ", the output is "hello world" — the whole line is wrapped. Per Word splits each line into individual words and wraps each word separately. For hello world with the same quotes, output is "hello" "world". Per Character wraps every single character individually. For abc with prefix [ and suffix ], output is [a][b][c]. Use Per Line for list formatting (SQL, HTML, CSV). Use Per Word for wrapping individual tokens in code or data. Use Per Character for visual effects, encoding, or character-level processing.
Rotating pairs cycles through a list of prefix/suffix combinations, applying pair 1 to line 1, pair 2 to line 2, pair 3 to line 3, then wrapping back to pair 1 for line 4, and so on. For example, with three pairs: [red]…[/red], [green]…[/green], [blue]…[/blue], a 6-line input would output red/green/blue/red/green/blue. Common use cases: generating alternating row colours in HTML table rows (<tr class="odd"> / <tr class="even">), building CSS variable definitions with cycling names, creating multi-colour formatted output, or generating test data with different prefixes for alternating database entries. You can add up to 10 pairs using the "+ Add pair" button.
Template mode lets you write a complete pattern string and uses special placeholders that get replaced for each line: {{LINE}} is replaced with the original line content; {{N}} is replaced with the sequential line number (1, 2, 3…); {{UPPER}} is replaced with the line content converted to UPPERCASE; {{LOWER}} is replaced with the line content converted to lowercase; {{TRIM}} is replaced with the line content with whitespace stripped. For example, the template <a href="/products/{{LOWER}}" id="link-{{N}}">{{LINE}}</a> applied to Blue Widget on line 3 produces <a href="/products/blue widget" id="link-3">Blue Widget</a>. Template mode is the most powerful mode for generating structured output like HTML, SQL, XML, or configuration files where each line contributes to a complete statement.
The conditional filter controls which lines receive the prefix/suffix treatment. There are five condition modes: All lines (default, no filtering — every line is processed); Line matches regex — only lines where the line content matches the JavaScript regular expression in the condition field are processed (non-matching lines pass through unchanged); Line does NOT match regex — the inverse, only non-matching lines are processed; Line length ≥ N chars — only lines that are at least N characters long are processed; Non-empty lines only — only lines that have at least one non-whitespace character are processed. Lines that do not meet the condition appear in the output exactly as they were in the input — they are not skipped or deleted, just left unchanged.
Remove mode strips an existing prefix and/or suffix from each line — but only if the line actually starts or ends with the specified text. If a line doesn't start with the specified prefix, it's left unchanged (not broken). For example, if your input has lines like 'apple', and you specify remove-prefix ' and remove-suffix ',, the output is apple. This is the exact reverse of the add operation and is useful when you need to clean up text that was previously formatted by this or another tool. Common use cases: stripping SQL quotes from a query result to get plain values, removing HTML tags from a list, or cleaning up a copied array of strings that has JavaScript quote syntax.
HTML export wraps each output line in a <div> element and places them all inside a <div class="lt-output"> container. You can paste this directly into an HTML document. JSON export produces a properly formatted JSON array where each output line is a string element, with proper escaping of special characters. Ready to paste into JavaScript, Python, or any JSON-consuming system. CSV export wraps each output line in double quotes with proper CSV escaping (internal double quotes are doubled), and produces a single-column CSV. You can import this into Excel, Google Sheets, or any CSV-aware database tool. The CSV header row is "Content". All export formats are generated from the same processed output as the plain text view.
Alternating Lines mode applies one prefix/suffix to odd-numbered lines (1, 3, 5…) and a different prefix/suffix to even-numbered lines (2, 4, 6…). Common use cases include: HTML table rows — odd lines get <tr class="odd"> wrapper, even lines get <tr class="even">; alternating CSS classes — generating list items with alternating class names for zebra-striping; Q&A formatting — odd lines are questions (prefix Q: ), even lines are answers (prefix A: ); two-column output — odd lines get a left-column wrapper, even lines get right-column wrapper; diff-style output — odd lines get + prefix, even lines get - prefix to simulate a diff format.

LazyTools vs other prefix/suffix tools

How we compare on features that developers, marketers, and data engineers actually need.

Feature LazyTools ✦ browserling.com onlinetexttools.com miniwebtool.com phrasefix.com
Per-line prefix + suffix
Per-word prefix + suffix✓ separate tool
Per-character prefix + suffix
Wrap entire text (one prefix/suffix total)✓ toggle
Alternating odd/even lines (2 different pairs)
Template mode ({{LINE}} {{N}} {{UPPER}}…)
Rotating multi-pair cycles (up to 10)
Remove prefix/suffix mode✓ separate tool
Conditional filter (regex match/not-match)
14 quick-wrap presets
N-space indent control
HTML / JSON / CSV export✓ 4 formats
Stats (processed / skipped / chars added)
100% client-side, no sign-up