Trim & Clean

Active tool: Trim and Clean

Selected option: Add/Remove line prefix/suffix

What It Does

Prepends or appends a custom string to every line, or removes an existing prefix/suffix from every line.

How to Use

  1. Paste your multi-line text into the input area.
  2. Enter the prefix and/or suffix string.
  3. Choose whether to add or remove.
  4. Click “Apply”.

Options Explained

OptionDescription
PrefixText added to the beginning of each line
SuffixText added to the end of each line
Skip empty linesDo not modify lines that are blank

Example

Prefix: - , Input: Item 1 / Item 2 → Output: - Item 1 / - Item 2

Removal compares against trimmed text, but indentation and trailing spacing stay untouched.

About Add & Remove Line Prefixes/Suffixes

The Add & Remove Line Prefixes/Suffixes tool lets you prepend or append text to every line in your input, or strip existing prefixes and suffixes from each line. This is a powerful batch operation for formatting lists, wrapping lines in markup, adding numbering, or cleaning structured data. You can optionally skip empty lines to keep your output tidy, and trim whitespace before attempting prefix or suffix removal for more reliable matching.

Line-level affix operations are common in development and data preparation. Adding a prefix like a bullet point, a SQL keyword, or an HTML tag to every line transforms plain lists into formatted output ready for use. Removing consistent prefixes — such as log timestamps, line numbers, or quoting characters — extracts the core content from structured text. These batch transformations save significant time compared to editing each line individually.

Common Use Cases

  • Adding bullet points or numbering to plain-text lists
  • Wrapping each line in HTML tags like <li> or <option>
  • Prepending SQL INSERT or VALUES syntax to data rows
  • Removing log timestamps or line numbers from pasted output
  • Adding quotation marks or delimiters for CSV or JSON formatting
  • Stripping email quoting characters from forwarded messages

What Are Line Prefixes and Suffixes?

In text processing, a prefix is a string that appears at the beginning of a line, and a suffix is a string that appears at the end. Adding or removing prefixes and suffixes is a batch transformation that modifies every line of a multi-line text block in a single step. This operation is widely used in programming to comment or uncomment code, in data formatting to wrap lines in delimiters or tags, and in content editing to add bullet points, numbering, or quoting characters. Unlike find-and-replace, affix operations target only the start or end of each line, making them more precise and less error-prone.

Frequently Asked Questions

Can I add a prefix and a suffix at the same time?

Yes. Fill in both the “Add prefix” and “Add suffix” fields. Both will be applied to every non-empty line in a single operation.

What does “Skip empty lines” do?

When enabled, blank lines are left untouched. This prevents empty lines from receiving a prefix or suffix, which would turn them into non-empty lines containing only the affix text.

Can I remove a prefix and add a different one in the same step?

Yes. The tool first removes the specified prefix/suffix, then adds the new one. This lets you replace a line-level marker in a single operation.

Is my text sent to a server?

No. All processing happens locally in your browser. Your text is never transmitted or stored.

This tool processes your text entirely in your browser. No data is sent to any server, ensuring complete privacy for sensitive or confidential content.