User Rating 0.0
Total Usage 0 times
0 lines · 0 chars
Presets:
0 lines · 0 chars
Is this tool helpful?

Your feedback helps us improve.

About

Manually prepending or appending strings to hundreds of text lines introduces transcription errors and consumes hours of labor. A misplaced delimiter in a CSV column or a missing SQL quote wrapper can cascade into data corruption across entire pipelines. This tool processes each line of input text by attaching a user-defined prefix before and a suffix after every line, with options to trim whitespace, skip empty lines, and inject sequential line numbers. It operates entirely in-browser with zero data transmission.

Common applications include wrapping database values in SQL quote syntax, adding HTML tags to plain text lists, prepending log-level identifiers to raw log entries, and constructing bulk CLI commands from hostname lists. The tool assumes UTF-8 input and treats newline characters (LF or CRLF) as line delimiters. Note: lines containing only whitespace are treated as empty when the skip-empty option is active, after trimming is applied.

prefix suffix tool text line editor bulk text formatter add text to lines prepend append text

Formulas

The transformation applied to each line Li in the input text is a simple concatenation operation:

Outputi = P + Ni + Li + S

Where P = the user-defined prefix string, S = the user-defined suffix string, Li = the content of line i (optionally trimmed), and Ni = the optional line number component (empty string when numbering is disabled).

When line numbering is enabled, Ni is computed as:

Ni = padStart(i, w, "0") + D

Where w = digit width calculated as floor(log10(totalLines)) + 1, and D = the numbering delimiter (default: ". "). Lines are processed sequentially. When skip-empty is active, empty lines are excluded from the output array entirely, and the numbering counter i only increments for non-empty lines.

Reference Data

Use CasePrefixSuffixExample Input LineExample Output Line
SQL Value Wrapping"",John Doe"John Doe",
HTML List Items<li></li>Apples<li>Apples</li>
CSV Quoting"",raw value"raw value",
Markdown Checkboxes- [ ] Buy groceries- [ ] Buy groceries
Log Level Prefix[INFO] Server started[INFO] Server started
Bash Echo Commandsecho "";Hello Worldecho "Hello World";
XML Tags<item></item>Widget<item>Widget</item>
URL Path Buildinghttps://api.example.com//detailsuser/42https://api.example.com/user/42/details
Python List Strings"",alpha"alpha",
Numbered PrefixStep (+ numbering).Mix ingredientsStep 1. Mix ingredients.
CSS Class Prefix. {}header.header {}
Regex Alternation()|pattern(pattern)|
Email Domain Append@company.comjdoe[email protected]
Comment Lines// deprecated function// deprecated function
Pipe Delimiter| |Cell Data| Cell Data |

Frequently Asked Questions

When "Trim Lines" is enabled, leading and trailing whitespace is stripped from each line before the prefix and suffix are applied. If "Skip Empty Lines" is also enabled, lines that become empty after trimming are excluded from the output entirely. When both options are disabled, whitespace-only lines are preserved and receive the prefix and suffix like any other line.
No. The numbering counter only increments for lines that appear in the output. If you have 10 input lines and 3 are empty (and skipped), the output will number lines from 1 to 7 with no gaps. The zero-padding width is calculated based on the total count of non-empty lines.
The prefix and suffix fields accept any printable character including spaces and punctuation. Literal tab characters can be pasted into the fields. However, newline characters within prefix or suffix fields would break the line-based processing model and are therefore treated as single spaces.
The tool processes text synchronously in the browser's main thread. For typical use cases under 50,000 lines, processing is instantaneous (under 16ms). Texts exceeding 100,000 lines may cause a brief UI freeze of 50-200ms depending on hardware. There is no hard limit, but browser tab memory constraints (typically 1-4 GB) apply to the total string size.
The tool normalizes all line endings to LF (\n) during processing regardless of whether the input uses CRLF (Windows) or LF (Unix/macOS). The output consistently uses LF. If you need CRLF output for a Windows-specific workflow, you can set the suffix to \r or post-process the downloaded file.
The insertion order is: Prefix first, then Line Number, then the original line content, then Suffix. For example, with prefix "> ", numbering enabled, and line content "Hello", the output is "> 1. Hello". This order ensures the prefix acts as a universal wrapper and the number stays adjacent to the content.