To add a prefix to each line on Windows, paste your text into a browser-based tool, type the prefix you want in front of every line, optionally choose whether blank lines should stay untouched, and download the resulting file as a UTF-8 TXT in well under a minute. The tool Add Prefix and Suffix to Lines handles up to 1,000,000 characters, recognizes Windows CRLF line endings, preserves the order and exact content of your lines, and concatenates a literal prefix and suffix around each one without treating punctuation as a regular expression. Processing runs entirely in the browser, so nothing is uploaded, and the downloaded file is a plain UTF-8 text blob with no byte-order mark, no rich-text styling, and no automatic quoting.

Windows users tend to reach for Notepad, Notepad++, PowerShell, or a small script when a list of lines needs the same characters added in front. Each of those options works, but each also adds friction: Notepad has no native column editing for arbitrary prefixes, Notepad++ macros need setup, PowerShell requires the right escape rules for backslashes and quotes, and sed is not part of Windows by default. A browser tool sidesteps all of those requirements, accepts text pasted directly from Notepad or Word, and produces a file you can save anywhere on disk.

add prefix to each line on windows
Add a Prefix to Each Line on Windows in Your Browser

Why a Browser Tool Fits the Windows Workflow

Windows text often arrives with CRLF line breaks — the two-character sequence a carriage return followed by a line feed that Notepad and many Windows applications write by default. If you paste CRLF text into a tool that only splits on LF, you may end up with phantom carriage returns sitting at the end of each entry, which can break downstream SQL, CSV, or log parsers. The Add Prefix and Suffix to Lines tool splits on CRLF, CR, and LF so the input is read the way Windows users expect, and it joins the output with LF so the resulting file is portable and predictable.

The tool also avoids the most common Windows pitfalls of script-based solutions. PowerShell's -replace operator treats its pattern as a regular expression, so a literal prefix like $env: or C:\Logs\ has to be escaped carefully to avoid unintended capture-group expansion. Because the prefix here is treated as a literal string, brackets, backslashes, dollar signs, asterisks, parentheses, and quotes are inserted exactly as typed. The same predictability helps when the prefix contains characters that have meaning in Markdown, HTML, or shell comments.

How to Add a Prefix to Each Line on Windows

  1. Open Add Prefix and Suffix to Lines in Chrome, Edge, Firefox, or any modern Windows browser. Nothing is installed.
  2. Paste your text into the input area, or type the lines directly. You can paste from Notepad, Notepad++, Word, a CSV file opened in a text editor, or any source — the tool accepts up to 1,000,000 characters.
  3. Type your prefix into the Prefix field. Leave the Suffix field empty if you only want a prefix, fill both for combined decoration, or use only the Suffix field for trailing punctuation. Each field accepts up to 200 Unicode characters.
  4. Choose the blank-line behavior. Enable the option to leave blank lines unchanged if you want empty lines and whitespace-only lines returned exactly as they are. Disable it to decorate every line, even those that are empty or contain only spaces.
  5. Click Generate. The exact transformed text appears in a preview that preserves spaces and newlines while allowing long visual wrapping without inserting real line breaks into the file.
  6. Inspect the preview, then download the result as a UTF-8 TXT file. The downloaded file contains the exact generated string rather than copied rendered HTML.

If you need a more editor-driven approach on Windows, the guide Add a Prefix to All Lines in Notepad++ and Online shows the column-edit method in Notepad++ side by side with the browser alternative.

How Windows CRLF and Trailing Newlines Are Treated

Windows files saved by Notepad traditionally end every line with a carriage return plus a line feed (CRLF). When that file is pasted into the browser, both characters are recognized as a single line boundary. The output is then joined using LF only, so the resulting TXT behaves the same whether it lands on a Windows, macOS, or Linux downstream system.

A trailing newline at the end of the input creates one additional empty logical line. That final line is decorated with the prefix and suffix when the blank-line option is off, and left empty when the option is on. This is deliberate: a final newline marks a real boundary in the input, and silently dropping it would change the structure of the file. Editing the input, prefix, suffix, or blank-line setting clears the previous result and revokes its download URL, so an older file cannot remain downloadable after the controls describe different output.

What the Tool Preserves and What It Changes

The transformation is intentionally narrow. The table below summarizes, from the documented behavior, which properties of your input are kept exactly as they were and which are affected by the prefix and suffix you supply.

Aspect of the input What happens
Line order Preserved; lines are returned in the original order.
Original line content Preserved; no trimming, case changes, deduplication, or sorting.
Internal spaces and tabs Preserved; nothing is collapsed or removed inside a line.
Line endings in output Normalized to LF, regardless of CRLF, CR, or LF in the input.
Trailing newline in input Becomes one additional entry, decorated or left empty per the blank-line setting.
Blank or whitespace-only lines Decorated when the blank-line option is off, returned unchanged when it is on.
Prefix and suffix characters Inserted literally; brackets, backslashes, dollar signs, and asterisks have no special meaning.
File format on download UTF-8 plain text, no byte-order mark, no rich-text styling, no CSV or spreadsheet quoting.

Common Windows Tasks That Need a Prefix

Several routine Windows text jobs map directly onto a literal prefix-and-suffix operation. Commenting out a block of code in PowerShell, batch, or SQL becomes a matter of adding a leading #, REM, or --. Turning a column of values copied from Excel into a SQL IN list is a matter of wrapping each line with parentheses and quotes, for example (' in front and '), at the end. Log lines often need a timestamp or severity tag such as [INFO] prepended; shell command snippets in documentation benefit from a $ prompt marker so each line is clearly an interactive command.

The same approach works for Markdown bullets, HTML list items, and CSV quoting. Surrounding identifiers with single or double quotes, adding a closing semicolon after each entry, and indenting a block of YAML by a fixed number of spaces are all literal affixes. Because the affixes are inserted as written, the result is predictable and can be inspected before the file is saved. If the downstream format has its own escaping rules — for example, JSON strings requiring escaped quotes — verify or escape the generated text for that format separately.

When the task goes beyond a literal prefix or suffix, the right tool changes. For numeric prefixes like 1., 2., 3., use Add Line Numbers. To replace one substring with another across lines, use Find and Replace. To turn a list into a paste-ready JSON array, SQL IN clause, or CSV row, use Add Quotes to Each Line. The Add Prefix and Suffix to Lines tool stays focused on the narrow job of decorating each line with literal text at the start, end, or both.

Privacy and Limits on Windows

Decorative processing happens locally in the browser tab: the input is never uploaded to a remote server, the preview is generated from the in-memory string, and the download is created from a local UTF-8 Blob. The Blob API used to assemble the download is part of the standard browser environment and is documented at MDN — Blob. The input is bounded to 1,000,000 characters to keep browser memory and rendering responsive on large transformations. Each prefix and suffix is limited to 200 Unicode characters, and at least one of them must be non-empty, because producing an unchanged duplicate would add no value and could make the current result visually indistinguishable from the input.

Emoji and non-Latin text are supported because the operation uses JavaScript strings and the resulting Blob is labeled UTF-8 plain text; how any given grapheme cluster displays still depends on the font and downstream editor. The downloadable file is plain text only — no byte-order mark, no spreadsheet quoting, no filename-derived prefix, and no automatic delimiter detection — so the file opens the same way in Notepad, Notepad++, VS Code, or a PowerShell Get-Content call.