Line Prefix and Suffix Editor

Add a literal prefix and suffix to every text line, including blank lines.

Processing stays in this browser. Each input is limited to 100,000 characters.

Prefix and suffix are literal text, up to 100 characters each. They are applied to every logical line; no regex or template expansion occurs.

Add text around each line

Add a literal prefix and suffix to every text line, including blank lines. Paste your source and enter Prefix and Suffix, then choose Process text. Results can be copied or downloaded. The tool retains the input so you can compare before replacing any source. Changing a setting or input clears the previous result and download.

Work through the example

Load the example, enter [ as Prefix and ] as Suffix, then run. The three output lines are [alpha], [beta] and [gamma]. Empty affixes are allowed and leave that side unchanged. The example action replaces input and settings. Keep any important original separately before using it.

Matching and transformation rules

Prefix and suffix are literal text, up to 100 characters each. They are applied to every logical line; no regex or template expansion occurs. Blank lines receive both affixes too. A final newline is retained but does not create an additional decorated line. Existing prefixes are not recognized or removed. Prefixes and suffixes cannot contain a line break. The output limit is two million characters, so large expansions can be rejected without changing your input.

The algorithm retains the line terminators it receives for each output line. Browser textareas can normalize pasted CRLF or CR to LF before processing, so this is not a byte-preserving file editor. Retain the original file if its encoding or exact line-ending bytes matter.

Limits and troubleshooting

Each text input supports 100,000 UTF-16 code units. Empty input is rejected; whitespace-only lines remain meaningful and count toward the selected range or transformation. No disk file is modified and a page reload discards the current state.

Use Text Compare to inspect the decoration before replacing a source. Line Number Adder adds a changing sequential prefix instead of the same literal prefix on every line.