Skip to content

Add Prefix and Suffix to Lines

Add literal prefix and suffix text to every pasted line, with an option to leave blank lines untouched.

Privacy: your files never leave your device. All processing happens locally in your browser.

How to use

  1. 1.Paste or type the lines you want to decorate.
  2. 2.Enter a prefix, a suffix, or both, and choose whether whitespace-only lines stay unchanged.
  3. 3.Generate the exact result, inspect the preview, and download the UTF-8 TXT file.

About Add Prefix and Suffix to Lines

Add Prefix and Suffix to Lines places user-supplied text before and after every logical input line. Paste or type up to 1,000,000 characters, enter a prefix, a suffix, or both, choose whether blank lines should remain unchanged, and generate the result. The exact transformed text is shown in a preview and can be downloaded as a UTF-8 TXT file. Processing stays in the browser and the text is never uploaded to Lizely.

The prefix and suffix are literal strings. Characters such as brackets, quotes, dollar signs, backslashes, asterisks, and parentheses are inserted exactly as entered; they are not treated as regular expressions, replacement tokens, Markdown, HTML, or code. This makes the transformation predictable for list markers, quotes, delimiters, SQL fragments, logging tags, shell comments, and simple data preparation.

Line order and original line content are preserved. The tool does not trim the beginning or end of a line, collapse internal spaces, change letter case, remove tabs, sort entries, or deduplicate values. It only concatenates prefix + original line + suffix for each line selected by the blank-line policy. A visual wrap in the preview does not add a real newline to the downloaded file.

Windows CRLF, classic Mac CR, and Unix LF boundaries are recognized and normalized to LF in generated output. A trailing newline creates a final empty logical line. When blank lines are decorated, that final line receives the prefix and suffix; when blank lines are skipped, it remains empty. This behavior is deliberate so the result does not silently lose the final line boundary represented by the input.

With Leave blank lines unchanged enabled, both empty strings and lines containing only whitespace are returned exactly as they were. A line with spaces is therefore not decorated, and its spaces are not removed. With the option disabled, every logical line is decorated, including empty and whitespace-only lines. The choice changes transformation coverage but never deletes a line.

Each prefix and suffix is limited to 200 Unicode characters. At least one must be non-empty, because producing an unchanged duplicate would add no value and could confuse the current result with the input. Emoji and non-Latin text can be inserted because the operation uses JavaScript strings and the generated Blob is labeled UTF-8 plain text. Unicode grapheme display still depends on the user's font and downstream editor.

Editing the input, prefix, suffix, or blank-line setting clears the old result and revokes its download URL. This prevents an earlier result from remaining downloadable after the controls describe different output. Empty input and exceeded limits create visible errors. The input is bounded to keep browser memory use and rendering responsive during large transformations.

The preview uses a preformatted region that preserves spaces and newlines while allowing long visual wrapping. The downloadable file contains the generated string rather than copied rendered HTML. It has no byte-order mark, rich-text styling, spreadsheet quoting, CSV escaping, filename-derived prefix, or automatic delimiter detection. If a downstream format has escaping rules, verify or escape the result for that format separately.

Use this tool to add bullets, comment markers, quotes, paths, HTML fragments, delimiters, indentation, or closing punctuation to a line list. It is also useful for surrounding identifiers with quotes or parentheses. It does not find and replace text inside lines, add sequential numbers, parse CSV fields, edit a Word document, or infer syntax. Use Add Line Numbers for numeric prefixes and Find and Replace for substring changes.

Methodology & sources

Validate bounded input and literal affixes, require at least one non-empty affix, split CRLF, CR, and LF while retaining trailing empty lines, test whitespace-only status only when the skip option is enabled, concatenate prefix and suffix without interpretation, join with LF, preview the exact output string, and expose a local UTF-8 text Blob.

Frequently asked questions

Are prefix and suffix treated as regular expressions?
No. Both are inserted literally, so punctuation and backslashes have no special replacement meaning.
What counts as a blank line when skipping is enabled?
An empty line or a line containing only whitespace remains exactly unchanged.
What happens to CRLF line endings?
CRLF, CR, and LF are recognized, and the generated result uses LF consistently.
Is my text uploaded?
No. Decoration, preview generation, and TXT download creation run locally in the browser.

Text Tools guides

View all