Add Prefix and Suffix to Lines can decorate up to one million characters of text in a single browser pass, inserting a literal prefix and/or suffix before and after every logical line while preserving line order, internal whitespace, and the original line content. Because the tool runs entirely inside the current tab, large pasted blocks are processed on the device rather than transmitted to a remote service, which matters when the text contains logs, customer records, code samples, or anything else you would rather not upload. The output downloads as a plain UTF-8 TXT file with no byte-order mark, no rich-text styling, no spreadsheet quoting, and no automatic delimiter detection, so the result is what you typed plus what you chose to wrap around it. That combination — a hard input ceiling, a local processing path, and a deliberately unformatted download — is what makes the tool suitable for prefixes across big line lists where ordinary find-and-replace or column-to-CSV helpers would distort the data.

add prefix to each line large text
Add a Prefix to Each Line of Large Text in the Browser

Why Large Text Needs a Different Workflow

When the input is a few dozen lines, almost any find-and-replace trick works. When the input crosses tens of thousands of lines or hundreds of thousands of characters, the assumptions that make small jobs easy start to break. Editors truncate pastes at a fixed column or character ceiling. Spreadsheet tools add quoting, escape characters, or line-ending conversions you did not ask for. Server-side processors mean your text leaves the machine, which is a problem for logs, customer identifiers, internal documentation, and anything covered by a confidentiality clause. Even local scripts on the command line can mangle a multi-megabyte paste through shell quoting or buffer limits.

The Add Prefix and Suffix to Lines tool is built for that middle ground: text that is too long to hand-edit and too sensitive to upload, but still small enough that a browser tab can handle it in one pass. The hard ceiling is one million characters of input, and the entire decoration step — splitting on line boundaries, concatenating prefix and suffix, joining back together, and producing a UTF-8 text Blob — runs locally in JavaScript. No character of the input ever leaves the device, and the result file is built from a Blob object on the client rather than streamed back from a remote endpoint.

What the Tool Handles at Scale

A few guarantees matter more when the text is large, because a single surprise normalization or byte-order mark can break a downstream grep, a CI log parser, or a SQL loader. The table below lists the input characteristics the tool accepts and how each one is reflected in the output.

Input characteristicBehavior in the tool
Up to 1,000,000 charactersAccepted in a single paste; errors only when the limit is exceeded
CRLF line endings (Windows)Recognized on input and normalized to LF in the generated output
CR line endings (classic Mac)Recognized on input and normalized to LF in the generated output
LF line endings (Unix)Preserved as LF in the output
Trailing newline at the end of the inputBecomes a final empty logical line that is decorated or skipped according to the blank-line policy
Emoji and non-Latin charactersCarried through as JavaScript strings and emitted as UTF-8 in the downloaded TXT
Visual wrap inside the preview paneCosmetic only; does not add real newline characters to the downloaded file

That last row is the one that surprises people working with wide text. A long line of joined SQL fragments or a single log entry with no spaces can wrap visually in the browser preview, but the wrap is purely a display behavior of the preformatted region. The downloaded file contains the true line as one unbroken string. If you want to see how many actual lines you have before you decorate, the Line Counter can give you the total, blank, and longest-line counts from the same input.

How to Add a Prefix to Each Line of Large Text

The flow is the same whether the input is twenty lines or two hundred thousand, because the work happens in one pass once you click generate.

  1. Paste or type the lines you want to decorate into the input area. Up to one million characters are accepted, so a single paste is enough for almost any line list you would realistically edit by hand.
  2. Enter a prefix, a suffix, or both. Each one is capped at 200 Unicode characters, and at least one of the two must be non-empty, so the tool will refuse a request that would simply echo the input back.
  3. Choose whether whitespace-only lines should stay unchanged. When on, empty strings and whitespace-only lines are returned exactly as they were; when off, every logical line is decorated, including empty and whitespace-only ones.
  4. Click generate to produce the exact transformed string. The preview shows the decorated output in a preformatted region that preserves spaces and indentation while allowing long lines to wrap visually.
  5. Inspect the preview against your source, then download the result as a UTF-8 TXT file. The Blob is labeled UTF-8 plain text and contains only the generated string with no byte-order mark, rich-text styling, or filename-derived prefix.

If your input originally came from a Windows log file or a Mac classic text export and you want to verify the line-ending handling before downloading, the Line Break Converter can show you the exact sequence in your source. That confirmation step is worth doing once on a large file, because the tool's normalization is silent and there is no separate "normalized" preview.

Literal Prefix and Suffix Strings

The most important property of the prefix and suffix inputs is that they are treated as literal strings. They are not regular expressions, replacement tokens, Markdown, HTML, or template syntax. A backslash, a dollar sign, an asterisk, a parenthesis, a square bracket, and a quotation mark all go into the output exactly as they were typed, with no escaping and no backreference expansion. That sounds mundane until you remember that the alternative is the usual set of surprises: a stray dot that silently matches every character, a dollar-one that drops the first captured group, or a Markdown heading that adds a heading style the moment it lands in a compatible editor.

The literal behavior is what makes the tool predictable for the things people actually decorate large line lists with: SQL fragments, shell comments, log tags, list markers, HTML delimiters, and quoting characters. A common pattern is wrapping identifiers with a single quote or a backtick, which is why the table below shows what the input and output look like for typical large-text use cases.

Use casePrefixSuffixSample inputSample output
SQL IN clause values'',102310421099'1023','1042','1099',
Shell comments in a script# (empty)echo startedexit 0# echo started# exit 0
Markdown bullet list- (empty)milkbreadeggs- milk- bread- eggs
Log severity tags[INFO] (empty)user signed incache miss[INFO] user signed in[INFO] cache miss

None of those prefixes is interpreted. The brackets in [INFO] stay as square brackets, the apostrophes in '1023', stay as apostrophes, and the hash in # echo started stays as a hash. If you want a transformation that actually matches and replaces substring content inside lines, that is a different job and needs substring matching with literal text, which is not what this tool does.

Blank Lines, Trailing Newlines, and the Whitespace Policy

One switch controls how empty and whitespace-only lines are treated, and the choice is more important than it looks because it determines how many lines are actually decorated.

Blank-line settingEmpty lineWhitespace-only lineNon-blank line
Leave blank lines unchanged (on)Returned unchangedReturned unchanged with its spaces intactDecorated with prefix and suffix
Apply prefix and suffix to every line (off)Decorated with prefix and suffixDecorated with prefix and suffixDecorated with prefix and suffix

There is one detail that catches people the first time they decorate a large file: a trailing newline at the end of the input creates one final empty logical line. With "Leave blank lines unchanged" enabled, that final line is preserved as empty, which keeps the file boundary visible. With the option disabled, the final empty line is decorated just like any other line, so the result ends with the prefix, the suffix, and an LF. The choice never deletes a line, but it changes whether the final boundary is decorated or left as a clean separator.

It is worth listing what the tool does not do, because the omissions are deliberate: it does not trim the beginning or end of each line, it does not collapse internal spaces, it does not change letter case, it does not remove tabs, and it does not deduplicate values. If the input has leading whitespace you want to keep, the tool keeps it. If the input has duplicate lines, the output has the same duplicates in the same order. That predictability is what lets the tool fit into pipelines that already trust the input's formatting.

Downloading and Reusing the Result

The generated string is exposed as a Blob labeled UTF-8 plain text, and the browser downloads it through a local URL that is revoked the moment you edit the input, the prefix, the suffix, or the blank-line setting. That revocation matters because it stops an older decorated version from staying downloadable after the controls describe something different. The file itself contains only the generated string — no byte-order mark, no rich-text styling, no spreadsheet quoting, no CSV escaping, no filename-derived prefix, and no automatic delimiter detection.

That last clause is the one to plan around. If the next step in your pipeline expects a particular escaping style, the result will not invent it for you. A SQL loader that needs backslash-escaped single quotes inside the wrapped values, a CSV consumer that expects doubled quotation marks around embedded quotes, and a JSON array that wants each value escaped with a backslash all require their own escaping pass. Run this tool for the prefix and suffix, then run a format-specific escaper for the inside of the line. Separating the two steps keeps the decoration predictable and the escaping correct.

The internal mechanics rely on standard browser primitives. According to MDN's documentation on the Blob interface, a Blob represents a file-like object of immutable raw data that can be read as text or binary and assigned a MIME type, which is exactly how the UTF-8 TXT download is constructed without ever round-tripping through a server. The string manipulation itself uses native JavaScript string operations, and the only normalization step is the line-ending conversion that turns CRLF and CR into LF before the prefix and suffix are joined back in.

For a deeper look, see Bash Add Quotes to Each Line: Sed, Awk, and Xargs.