Notepad++ removes duplicate lines through the menu path Edit → Line Operations → Remove Duplicate Lines, which deletes every repeated line from the active document or selection and keeps only the first occurrence of each value. The command was introduced in Notepad++ version 6.5.2 and works on plain text, code, log files, CSV exports, and any other line-oriented content the editor can open.
The built-in command compares each line exactly as it appears, including capitalization, leading and trailing spaces, tabs, internal spacing, punctuation, and Unicode characters. Under that rule "Apple" and "apple" remain two separate entries, and a line ending in one stray space differs from the same visible letters without it. If your list mixes casing or stray whitespace, you either need to clean the text first or switch to a tool that lets you toggle case-insensitive and trim-aware comparison. The command operates only on the buffer you can see; nothing is sent to a server, and Undo (Ctrl+Z) restores the file exactly as it was.

Where the command lives, and where the older one used to
Before Notepad++ 6.5.2 shipped its own duplicate-line command, the only widely used option inside the editor was the TextFX plugin. TextFX added a "TextFX Tools → Sort lines case insensitive (at column)" workflow that, combined with the surrounding delete-duplicate macro, was the canonical answer on forums for nearly a decade. That plugin was a 32-bit DLL, and modern 64-bit Notepad++ builds cannot load it. Many guides that still rank highly today reference TextFX because older posts stay indexed, but the plugin is no longer maintained and will not appear in current Plugin Manager listings.
Today's Notepad++ exposes the feature natively under menus you can see in any recent build. The two relevant entries are:
- Edit → Line Operations → Remove Duplicate Lines, the modern plugin-free path that deletes every repeated line in the active document or selection.
- Edit → Line Operations → Remove Consecutive Duplicate Lines, which collapses only runs of identical neighbours and leaves scattered repeats alone.
Both commands operate on the current selection if you have text highlighted, and on the whole document otherwise. The undo buffer keeps the original intact, so a quick Ctrl+Z recovers everything if the result is not what you expected.
How to Remove Duplicate Lines in Notepad++
The built-in command takes one menu click once your file is open. Follow these steps on any modern 64-bit build of Notepad++:
- Open your file with File → Open, or paste the list into a new tab. Each value must sit on its own line; if your text is comma-separated, run it through a column-to-list converter first so each value lands on its own row.
- Select the block of text you want to clean. If nothing is selected, Notepad++ runs the command across the entire document, so leaving the cursor anywhere in the file is safe.
- Click Edit in the menu bar, hover over Line Operations, then choose Remove Duplicate Lines. On large files a brief status-bar message confirms the operation completed.
- Scan the result. Because the comparison is case- and whitespace-sensitive, "orange" and "Orange " (note the trailing space) survive as separate lines. Spot-check the top and bottom of the changed region before saving.
- Press Ctrl+S to save, or File → Save As if you want to keep the original alongside the deduplicated version. Until you save, Ctrl+Z still reverses the change without leaving a trace.
If your duplicates cluster together rather than scattering through the file, use Edit → Line Operations → Remove Consecutive Duplicate Lines instead. That variant only collapses identical neighbours, which is useful for cleaning log files where the same line repeats in a burst before the system moves on to the next entry.
Case, whitespace, and blank lines
Notepad++'s built-in command treats each complete line as the comparison key, so every visible character participates. Three practical consequences follow from that design.
Capitalization matters. "Apple," "apple," and "APPLE" are three distinct keys, and all three survive a deduplication pass unless you pre-normalize the file. A quick Edit → Convert Case to → lower case before removing duplicates is the simplest workaround; doing so changes the retained text, so back up the file first or save the normalized copy under a different name.
Whitespace matters. A line containing " apple" (two leading spaces) is a different key from "apple" and will not be removed by the built-in command. Likewise, internal runs of spaces and tabs are part of the comparison, and a single trailing space on one line but not another is enough to keep both. If stray whitespace has crept into your list from copy-paste, run a normalize-whitespace pass before deduplication, or use a tool that can trim the edges of each comparison key without rewriting the retained output. MDN documents the standard String trim behaviour such a tool would rely on.
Blank lines are valid values. The first empty line is kept, every later empty line is treated as a duplicate, and the result therefore has at most one empty line at any given position. If your data should not contain blank values at all, follow the deduplication with Edit → Line Operations → Remove Empty Lines, or Remove Empty Lines (Containing Blank characters) when the lines contain whitespace-only entries.
A browser alternative that handles case and trim options
When you need finer control than a single click — for instance, treating "Apple" and "apple" as duplicates without rewriting the original casing, or treating a trailing-space line as identical to its trimmed neighbour — paste the list into the Remove Duplicate Lines tool. The browser-side routine builds a comparison key per line, drops any key that has already appeared in a Set, and joins the retained first occurrences with LF. Inputs are bounded at one million UTF-16 code units, which covers a substantial list of identifiers or a multi-megabyte log excerpt.
The three verified steps are:
- Paste one value per line into the input field. Empty input is rejected up front, so the count summary never reports a misleading one-line result.
- Toggle Ignore English letter case to fold Apple and apple together, and toggle Ignore edge whitespace to trim both ends of the comparison key. Trimming applies only to the key, not to the retained line, so the first occurrence's original spacing survives.
- Click the dedupe action. The result panel reports input, retained, and removed counts, shows the exact retained lines, and lets you copy them back out. Nothing is uploaded; the splitting, key construction, and joining all happen locally in the browser tab.
Combining the two toggles applies trimming first and English-locale lowercase second, which is the practical match for ordinary English lists but is not accent folding, Unicode normalization, fuzzy matching, or stemming. If your data mixes scripts or uses letters like the German sharp s, normalize them yourself before pasting.
Notepad++ vs a browser dedupe tool
Both options delete repeated lines and keep the first occurrence, but they answer slightly different needs. The table below lines up what each one does well.
| Capability | Notepad++ built-in | Remove Duplicate Lines tool |
|---|---|---|
| Where it runs | Inside the editor on the open file | In the browser tab, on pasted text |
| Case-insensitive comparison | No (case-sensitive only) | Yes, via a toggle |
| Edge-whitespace trim on the key | No | Yes, via a toggle |
| Output casing and spacing | Always preserved (no rewrite) | First occurrence preserved exactly |
| Maximum input size | Limited by file size and memory | 1,000,000 UTF-16 code units |
| Undo | Built-in Ctrl+Z on the file | Editing the input clears the result |
| Data leaves the device | No (file stays local) | No (processing is local) |
| Batch on many files | One file per command run | One paste per run |
The Notepad++ route is the right pick when your text is already in a file on disk and you want a single click with no copying. The browser tool is the right pick when the casing or whitespace rules need to change without rewriting the original, when you want an explicit removed-versus-retained count to paste alongside the result, or when the data lives in a chat window, an email, or a spreadsheet column rather than a saved file.
Keep the original until you've verified the result
Deduplication by a visible line is convenient, but for business records it is often weaker than deduplication by a stable database identifier. A customer name can be spelled two ways, an email can carry a stray space, and a product SKU can appear with a leading zero in one export and without it in another. If your goal is to delete rows from a real dataset, normalize the comparison column into a stable key first, dedupe by that key, and confirm the surviving rows match what you expected before deleting anything from the source.
A practical safety pattern is to make the deduplication non-destructive by default: save the original to a separate file (or copy the list into the browser tool with a clear name like list-original.txt), run the dedupe on a copy, and only overwrite the working file after a spot-check on the top, middle, and bottom of the retained set. MDN documents the Set data structure the browser tool relies on for its deterministic "have I seen this key before" check, and the same pattern is what every sensible dedupe routine should do.
If your follow-up step is the opposite of dedup — adding quotation marks, prefixes, or numbering — the editor path stays in Notepad++. A separate walkthrough covers how to add quotes to each line in Notepad++ without regex, which is a common companion task after deduplicating a list of identifiers, tags, or SQL values.
For a deeper look, see Remove Duplicate Words in a Cell in Excel.