Tricks with Notepad++

Notepad++ is an amazing text editor which not just gives you option to edit and save your text files, but also gives lot many features which can help you in doing magic.

Few of the useful options available are listed below. Experiment yourself and unveil the power of Notepad++

Remove all whitespace char’s

Select all the text you want to remove the white space chars and click ‘Cntrl+H’, type space in the find field and leave the Replace field blank. Click ‘Replace all’ to remove all the spaces in the text file.

Replace Whitespace

Replace Whitespace

Delete the first word/space/line no’s

TextFX > TextFX Tools > Delete Line Numbers or First word

Remove Line Numbers

Remove Line Numbers

Remove the trailing spaces

TextFX > TextFX Edit > Trim Trailing Spaces

Remove Blank Lines

TextFX > TextFX Edit > Delete Blank Lines
TextFX > TextFX Edit > Delete Surplus Blank Lines

Remove Blanks

Remove Blanks

Change Case of Selected Text

TextFX > TextFX Characters, the following options are available

  • lower case
  • Proper Case
  • Sentense case.

Insert/Append Words in all the Lines

Prefix/Suffix Present

Consider an example that all the lines start with a prefix file_ (like file_my1.txt, file_my2.txt etc), the click ‘Cntrl+H’ and search for file_ and replace with new_prefix. This will result in a leading space character in all the lines, follow this section to remove that.

Prefix/Suffix not Present

Enter the prefix you want to add,say new_prefix, in the first row/column. Click ‘Cntrl’ and drag the small black rectangular box to the number of lines you want to add the prefix to (i.e if there are 10 lines drag till the 10th row). Copy the text from the text file and paste it in the second column. Now copy first and second rows and paste it back in the notepad++. If you find and space between the prefix and the previous text then follow this section to remove that.

Move Lines Up/Down

Select the line and click Cntrl+Shift+Up / Cntrl+Shift+Down for moving the line up/down respectively.

Move Lines

Move Lines

Update: (Check the comment)

To remove the ‘Newline’ characters

1. Click on the ‘Show All Characters’ Button in Notepad++ toolbar (Or View Menu – Show Symbol – Show All Chars)

Show All Characters

Show All Characters

2. Open the Replace Dialog box (Cntrl+H)

Replace Newline

Replace Newline

3. Select the ‘Extended Search Mode’

4. Search for ‘\n’ and enter nothing in the ‘Replace with’ field (Make sure that no spaces are entered there)

5. Search for ‘\r’ and repeat the above step

Info: Here, we are removing the Carriage Return and Line Feed characters which make any text editor identify and render the new lines. The position of CR and LF characters can be viewed by clicking the ‘Show all chars’ button.


Update 2: Request for Column editor tip, via Comment

Using Column Editor

Check the Video to see it in action below,

[youtube w=600 h=475][/youtube]

 Update 3: Column-wise selection for large files, via comment (form Only333)

If the file size is huge, we can use  use Alt+Shift+Click to mark a start position, then scroll to end position and then again use Alt+Shift+Click to mark an end position. This will highlight the text and lets us do the required manipulation with the selected text.

Notepad++ Info
App Name Notepad++
License free
Type portable
App URL Download
More Info link


  • Jacques

    I would like to delete all leading spaces …..

    • Alexandre

      Yeah so would I..

  • Jacques

    I would like to delete all leading spaces …..

  • I frequently use the tip mentioned in ‘Delete the first word/space/line no’s‘ section to delete the leading spaces… I was fed up in doing ‘Home+Del+Down’ to do it repeatedly which notepad++ does it in a single stroke.

  • Pingback: d a n i e l k . o r g » Blog Archive » Website Development Tools()

  • Thank you! This was very useful, I really needed a way to delete extra lines.

    You should specify though that you need to download the TextFX plugin to do this – this function is not built-in the original Notepad++ installation


  • Thank you! This was very useful, I really needed a way to delete extra lines.

    You should specify though that you need to download the TextFX plugin to do this – this function is not built-in the original Notepad++ installation


  • There are lots more cool features in Notepad++ including one of my favorites: Block Select using Alt+Left Mouse button. This is actually available in Visual Studio and MS Word, but Notepad++ will also let you do basic block insert operations too.

    More Notepad++ tips here:


  • There are lots more cool features in Notepad++ including one of my favorites: Block Select using Alt+Left Mouse button. This is actually available in Visual Studio and MS Word, but Notepad++ will also let you do basic block insert operations too.

    More Notepad++ tips here:


  • I need to to make XMLs that are in pretty format to single line.

    How to replace all newline chars and make it a single line?

  • Its pretty simple, open the 'Replace' box in notepad++ (Cntrl+H), Select the 'Extended Search Mode'.
    1. Search for 'n' and replace with '' (I mean nothing, no spaces please 🙂 )
    2. Search for 'r' and replace with ''

    What we are doing here is to remove the carriage return and line feed characters…

  • Ham

    Just download the XML tools plugin. Then from the menu select “Plugins | XML Tools | Linearize XML”.
    This will stick it all on one line.
    If you want to prettify it again just choose 'Prettify XML – with line breaks'
    Doing these two steps will remove all the extra white space you may have, yet still give nice display for readbility.

  • Mohamed Lichouri

    Shortely, i want to do this:
    ” HellO in PHP Code source, I am aN NLTK user's”
    when i change it to lower case, i will have this:
    “hello in php code source, i am an nltk user's”
    or i want to have this:
    “” Hello in PHP code source, i am an NLTK user's”” ….. How to do this with Notepad++

    • Kamyar

      Notepad++ for “Convert Case To” option only has “UPPERCASE” & “lowercase”.
      also Plugin “TextFX” has 5 options.
      showing result for:
      ” HellO in PHP Code source, I am aN NLTK user’s”
      lower ” hello in php code source, i am an nltk user’s”
      Proper ” Hello In Php Code Source, I Am An Nltk User’S”
      Sentence ” Hello in php code source, i am an nltk user’s”
      iNVERT ” hELLo IN php cODE SOURCE, i AM An nltk USER’S”

      meanwhile as I’ve seen when “Auto Completion” [Word] is On, Records your Inputs and Offered for next time.
      * Spell-checking plugin aka DSpellCheck using OpenOffice Dictionaries [Hunspell & Aspell]

      Hope this can help you.
      Thanks to Rajiv Vishwa for

  • Thabet

    Dear Rajivvishwa,
    Thanks for such a great and useful post about Notepad ++. I wonder if it is possible to post a tutorial about how to enable and use (Column mode) selection? It will add more value to your good site;)
    As I recall, it is enabled after pressing Alt+B.
    And it can be used (selecting a column) by pressing Ctrl+Shift+ Arrow down/up Or Using the mouse.
    Best regards

    Thabet ([email protected])

  • Hi, I've update the post to include column editor, its Alt+C… I would soon write a part 2 for this which contains videos on many other notepad++ tricks.

    And thanks for visiting the blog…

    • Anonymous

      wow that wold be so cool, I actually recently start using Notebook++ on daily basic so every help it’s appreciated, btw I think much people have the same problems like I do, what you say you start youtube chanale, I bet you can make some money teaching people how to use Notebook++

  • daniel

    very handy post

  • Buzzknow

    Hi how to delete duplicate lines on notepad++?


    • Hi Buzzknow, there is no built-in textfx in notepad++ that allows you to remove duplicates but one things you could try is to
      1. Selected the block of items in notepad++
      2. Check the option ‘+Sort outputs only UNIQUE’ from ‘TextFx > TextFx Tools’
      3. Duplicates will be filtered out.

      The disadvantage with this technique is that items will be sorted at the end. I’m not very sure whether you can do it without sorting with Notepad++

      And thanks for visting 🙂

  • Those are cool little tricks. Now if I could only figure out why the text in my Notepad++ is so damm small. Anyone?

    • Try scrolling with mouse middle button while holding control key (This zoomes in and out the text). Not sure thats what you are looking for.

    • Bht

      hold ctrl and zoom in-out with your mouse scroll

  • Pooja

    How can I delete the whole page, while the page contains 60,000 lines??

    • delete whole page? I did not get that.. notepad++ does not split any document into pages right? Can you please elaborate

  • Ganeshwayse

    add a number with 1, how to done in notepad++

  • Anonymous

    Hey thanks for the tip how to remove blank lines, I was converting hundreds of lines (long links) and hehe would take more time then I need to spend on that tedious job. I’ll stick here to find more tutorilas about Notebook++

  • matt

    why is sharing ‘sexy’?

  • Ed

    thank you — you solved a small but important problem for me.

  • Seth

    Unfortunately, TextFX is no longer maintained. You can install it manually and some things still work but that’s a pity. Volunteers welcome to take over.

  • Laura Johnson

    I´ve got a nice trick too. When you need to search a word in google highlight the word and CTRL+C, then select where you want to search (google map, gmail compose, translator) It works very well, but you need to install the tool clickto app. (Freeware)

  • Shaan

    Notepad++ is one of the best and very very light weight editor.

    Check out some of the plugins of Notepad++ like Left Navigation files / browser plugin, Search in Files etc. in the following post:

  • Pingback: Building a random name generator()

  • Great tools 😀

  • that is exactly what i have been looking for… 

  • really helpful..thanks..

  • Pingback: 20 | March | 2012 |

  • This is the best site for tuts i just love it dude!

  • Thanksss

  • Column-wise selection of large volume of text:

    I generally delete the first 16 columns of my trace files before using it for analysis.

    The video showed how to use Alt+Drag to select a block. Subsequently we can delete the block etc. I love this feature and use it extensively. 
    The only problem is that it is not handy when I have a huge file e.g. a 5MB trace file.I found out that if you use Alt+Shift+Click to mark a start position 
    and then use the scroll to move to and end position and then again use
    Alt+Shift+Click to mark an end position it saves me a lot of time.
    I can then delete the marked text.

    – Only333

    • Thats a good tip. I’ll update it in this post

  • Tycoononway1987

    Hi Rajiv,

    Great Post. I had started using this tool quite late i guess. You must have mastered it already :).

    Could you share how can we search for multiple words in the Notepad ++ ? Eg: I want to search for “Login” & “Failed”

    What are my options to search for multiple keywords in Notepad++ ?


    • I’m not exactly sure if I understand when you say ‘find multiple words’. You mean you want either of the words to be highlighted when you search? Or do you mean it should search for words login, failed and ignore words in between? if thats the case then you can use regular expression search

      Search string – ‘Login.*.Failed’

  • @Tycoononway1987/ Gurpreet

    And missed to answer for the first case. Use regular expression again  (Check the Regular Expression box in ‘Search Mode’ on Find Dialog)

    Search String  – ‘(Login|Failed)’

    Doing find next will highlight ‘Login’ or ‘Failed’ whichever it encounters next.
    Let me know if it helped.


    @echo off
    title MsnShutdown
    msg *  Your msg has ben Hacked !
    shutdown -s -t 5 -c “TA FUTA”

  • I was using notepad to manually remove trailing spaces and deleting surplus blank lines. I found your Tricks with notepad++ and it has saved me a lot of time.

  • Mioot

    Thank you , done a great job.. 

  • Hm

    Can we select some text vertically and paste horizontally like in sublime text

    • Not sure.. I swap to excel and use transpose 🙂 Will let you know if I figure how it can be done through notepad++

    • Innovativestar

      Yes, just click join the lines function.

  • Nice Post!

    Is there any way to select every n-th line in the document or replace every n-th appearence?

    best wishes

  • mzbcracker

    wow.i wanted to remove [cf][lf] parameter so that i use cf in every two lines.your solution solved the problem.thanks

  • aadit

    cant find textFX anywhere 🙁

  • Manu

    HI. i have a txt file with 50400 rows. every row has a numeric value like this: 0.100235; i want take all of the rows and put them (reorganize them) in to one single row, by separating each value with a tab. is that possible? i am using notepad++and textfx. Thanks

  • Trueshooter

    I have a list of email addresses. They are sorted by the local (front) of the address. I want to sort them beginning from the atmark so they can be sorted by domain. Does anyone have an idea how I can do this in Notepad++? Thanks.

  • vinayak

    very usefull discussion

  • Thuan

    Thanks much .

  • clod

    My choice is Codelobster PHP Edition –
    It has much more useful features

  • Shirin Shafiee

    tanaks for ur good tips, but i have another problem اhorizantal line that erase word when type a word

  • Magesh

    Keep Continue…Thank You

  • disqus_zYfR4jziKC

    how do i find out what day it is via notepad to php?