Prefix/Suffix LinesAdd a prefix and/or suffix to each line of text.

Prefix/Suffix Lines
Add a prefix and/or suffix to each line of text.
Paste Text
Paste the text to modify.
Set Prefix/Suffix
Enter text to add before and/or after each line.
Copy Result
Copy the text with prefixes and suffixes applied.
What Is Prefix/Suffix Lines?
The Prefix/Suffix Lines tool adds custom text to the beginning (prefix) and/or end (suffix) of every line. You can set a prefix, a suffix, or both. An optional toggle skips empty lines so they remain clean. This is useful for formatting code, adding comment markers, creating list markup, wrapping lines in tags, or preparing text for specific formats.
Why Use Our Prefix/Suffix Lines?
- Add consistent text to the start or end of every line
- Option to skip empty lines
- Combine prefix and suffix in one operation
- Useful for code formatting and list creation
Common Use Cases
Code Commenting
Add comment markers (// or #) to the beginning of each line.
List Formatting
Add bullet points, numbers, or markers to each line.
HTML Wrapping
Wrap each line in HTML tags like <li> and </li>.
SQL Formatting
Add quotes and commas to values for SQL IN clauses.
Technical Guide
The tool splits the input by newline characters and processes each line. If the skip-empty-lines option is enabled, empty lines (those that trim to an empty string) pass through unchanged. For all other lines, the prefix is prepended and the suffix is appended using simple string concatenation. The processed lines are joined back with newline characters. Both prefix and suffix default to empty strings, so you can use just one or both.
Tips & Best Practices
- 1Use prefix "// " to comment out every line
- 2Use prefix "- " to create a Markdown list
- 3Use prefix "<li>" and suffix "</li>" for HTML list items
- 4Skip empty lines to keep paragraph breaks clean
Related Tools

Add Line Numbers
Add sequential line numbers to each line of text.

Indent/Dedent Text
Add or remove indentation from text with spaces or tabs.

Find and Replace
Find and replace text with support for regex, case sensitivity, and bulk operations.

Wrap Text at Width
Wrap text at a specified character width with word boundary respect.

Word Counter
Count words, unique words, characters, and see word frequency in any text.

Character Counter
Count characters with and without spaces, plus word, line, and paragraph counts.
Frequently Asked Questions
QCan I add just a prefix or just a suffix?
QWhat does "skip empty lines" do?
QCan I use special characters in the prefix/suffix?
QDoes it work with multi-line prefix/suffix?
QHow is this different from Indent?
About Prefix/Suffix Lines
Prefix/Suffix Lines is a free online tool from FreeToolkit.ai. All processing happens directly in your browser — your data never leaves your device. No registration required. No ads. Just fast, reliable tools.







