UT

Add Prefix & Suffix

Add a prefix and/or suffix to each line of your text.

What Is Add Prefix/Suffix?

Add Prefix/Suffix is a text tool that adds custom text to the beginning and/or end of every line in your input. Whether you need to prepend bullet points, wrap lines with HTML tags, or append semicolons to each line, this tool handles it instantly.

The output updates in real time as you type. This tool runs entirely in your browser — no text is sent to any server.

How to Use This Tool

1

Enter Your Text

Type directly into the input editor, paste content with Ctrl+V, or upload/drag a .txt file.

2

Set Prefix & Suffix

Enter the text to add before each line (prefix) and/or after each line (suffix). Leave either blank to skip it.

3

See Results Instantly

The transformed output appears in real time in the right panel as you type or change settings.

4

Copy or Download

Use Copy to copy the result to clipboard, Download to save as a .txt file, or Clear to reset.

Features Explained

Prefix & Suffix Fields

Enter any text in the Prefix field to prepend it to each line, and any text in the Suffix field to append it. Both fields support spaces, special characters, and symbols. Use them independently or together.

Skip Empty Lines

When enabled (default), empty lines are left untouched — no prefix or suffix is added to them. Disable this option if you want every line processed, including blank ones.

Real-Time Processing

The output updates instantly as you type in any field — the input, prefix, or suffix. No need to click a button to see results. The computation is memoized for performance.

File Upload & Drag and Drop

Upload a .txt file using the Upload button or drag and drop a text file directly onto the input area. The file contents replace the current input text.

Who Is This Tool For?

Developers

Wrap lines with HTML tags, add comment markers, prepend indentation, or append semicolons to code lines in bulk.

Data Analysts

Add delimiters, quote marks, or SQL syntax around data values for quick formatting before import or query building.

Writers & Editors

Add bullet points, numbering prefixes, or quote markers to lists and paragraphs for consistent formatting.

System Admins

Prepend timestamps, log levels, or hostnames to log entries. Append tags or metadata to configuration lines.

Marketers

Add hashtags, mentions, or tracking parameters to lists of keywords, URLs, or social media content.

Students

Format notes with consistent prefixes like "Q: " and "A: ", or add numbering to study material lines.

Common Prefix/Suffix Examples

PrefixSuffixExample OutputUse Case
"- """- First lineMarkdown bullet list
"<li>""</li>"<li>First line</li>HTML list items
"// """// First lineComment out code
"'""',"'First line',SQL/JS string array
" """ First lineAdd indentation
""";"First line;Append semicolons

Tips for Adding Prefix & Suffix

Wrap lines with HTML tags

Set prefix to an opening tag like "<li>" and suffix to the closing tag "</li>" to wrap every line in HTML elements.

Build SQL IN clauses

Set prefix to "'" and suffix to "'," to quote each line. Remove the trailing comma from the last line and wrap with IN(...).

Comment out code blocks

Set the prefix to "// " (with a space) to comment out every line in JavaScript, C, or similar languages.

Use Skip Empty Lines wisely

Keep it enabled to avoid adding prefixes/suffixes to blank lines, which keeps your output cleaner and more readable.

Combine with other tools

Use Add Prefix/Suffix with Sort Lines, Remove Duplicates, or Add Line Numbers for multi-step text processing workflows.

Add CSV quoting

Set prefix and suffix both to double quotes (") to wrap each line in quotes for CSV formatting.

Privacy & Security

This tool runs 100% in your browser. Your text is never uploaded to any server. It is stored only in your browser's local storage so it persists when you refresh the page.

You can clear it at any time using the “Clear” button. No cookies are used, no analytics track your text content, and no third-party services have access to what you type.