Add Prefix or Suffix to Every Line | Preserve Line Endings

TextRuns in Your Browser (No Uploads)

Add the same literal prefix or suffix to each source line while preserving LF, CRLF, CR, mixed separators, and a final line ending. Blank lines and the final suffix are explicit options, and processing stays in your browser.

What to do next

Continue with a related workflow or open the next tool that usually follows this task.

How to Use This Tool

Paste or upload the plain-text lines you want to modify.

Enter the literal prefix, suffix, or both, including any spaces you need.

Choose whether empty and whitespace-only lines should remain unchanged.

If a suffix is present, decide whether the last modified line should omit it.

Run the tool and compare the source-line and modified-line counts with your input.

Copy or download the result, then validate it separately if it will become JSON, CSV, SQL, shell, or HTML.

When to Use This Tool

Prepare a Markdown bullet list

Prepend "- " or "* " to plain task names before pasting them into a Markdown document.

Prepare delimiter-separated values

Append commas, semicolons, or another literal separator to copied values, with an option to leave the final item unsuffixed.

Wrap identifiers for a draft

Wrap each plain identifier with matching characters for a draft snippet, then validate the destination syntax separately.

Label logs and review notes

Add a fixed environment, ticket, or source label to every line in a support handoff or review note.

Preserve separators in copied lists

Add a fixed path segment or command argument marker to a plain list while retaining the file's Windows, Unix, classic Mac, or mixed line endings.

Common Mistakes

Expecting sequential numbering

A literal prefix such as "1. " repeats unchanged. Use a line-number tool when each row needs an increasing number.

Pasting a line break into an affix

An affix must stay on one line. Put only the characters that belong before or after each item in the setting field.

Treating literal insertion as format validation

The tool inserts text literally; it does not quote, escape, or validate JSON, CSV, SQL, shell, or HTML syntax. Validate the finished format with a dedicated tool.

Ignoring blank-line behavior

Empty and whitespace-only lines are source lines. Choose whether to modify them or leave them exactly as they were before running the conversion.

Overlooking the final delimiter or newline

A final source line ending is preserved, and a trailing delimiter may be rejected by the destination. Use the final-suffix option only when that destination requires it.

Examples

Add a bullet prefix to task lines

Set the prefix to "- " to turn plain task names into Markdown bullet items. The existing line separators remain unchanged.

Input
Review invoice
Attach receipt
Send report
Output
- Review invoice
- Attach receipt
- Send report

Add delimiters between copied values

Set the suffix to a comma and enable "Omit the final suffix" when a plain import list needs separators between values but not after the last value.

Input
alpha
beta
gamma
Output
alpha,
beta,
gamma

How line affixing and separator preservation work

The formatter scans CRLF, LF, and CR separators instead of splitting only on LF. It copies each separator exactly, so mixed files and a terminal line ending are not silently normalized.

A terminal separator ends the preceding source line; it does not create an extra synthetic empty line. The source-line metric follows that rule, which makes the displayed count match the actual affix operations.

Empty and whitespace-only lines can receive the same affixes as other lines or remain byte-for-byte unchanged. When blank lines are skipped, the modified-line metric excludes them.

Omitting the final suffix targets the last line that is actually modified, even when skipped blank lines follow it. The prefix still applies, and the source line endings are untouched.

Affixes are literal text, not a parser or escaping layer. Input is capped at 1 MiB, each affix at 4 KiB, source lines at 200,000, and predicted output at 4 MiB before the result is built in the browser.

Frequently Asked Questions

Can I add only a prefix or only a suffix?

Yes. Leave either field empty. At least one of the two affixes must contain text.

Does a prefix such as 1. increase on each line?

No. Every selected line receives the same literal text. Use Add Line Numbers when you need 1, 2, 3, and so on.

Are Windows and Unix line endings preserved?

Yes. LF, CRLF, CR, and mixed separators are copied exactly, including a line ending at the end of the input.

What happens to blank lines?

By default they receive the affixes too. Enable "Leave blank lines unchanged" to preserve empty and whitespace-only lines without modification.

What does Omit the final suffix do?

It removes the suffix only from the last line that the tool modifies. This is useful for delimiter-separated plain lists, but it does not validate the destination format.

Is the text uploaded, and what are the limits?

The conversion runs locally in the browser. The input limit is 1 MiB, each affix is limited to 4 KiB, the source is limited to 200,000 lines, and the predicted output is limited to 4 MiB.

How This Tool Was Verified

Maintained and tested by Reviewed

Method: In Add Prefix or Suffix to Every Line, the “Prepare fixed ticket labels without changing CRLF separators” fixture was run without repairing or simplifying its input. We verified the transition from “Confirm what one source line means” to “Decide blank-line and final-delimiter behavior”, compared the final artifact or values, and reviewed “Treating wrapped display text as source lines” plus “Modifying accidental blank rows” as non-success paths.

Expected result: Each of the three ticket lines received exactly one OPS: prefix, the original order and CRLF separators remained intact, and numbering was not simulated with a fixed string.

Open the tested workflow

Related workflow guides

Use these focused guides when you need a practical workflow before opening the tool.

Related Tools

Continue with another maintained workflow

Browse All Tools