Skip to content

How to Merge Multiple HTML Files using Notepad++

So the other day I was referring to an offline document that was actually just a compiled source of many HTML pages. Opening each page every time from the index proved to be quite tasking not to mention time intensive.

For that reason I set out to compile all these pages into one HTML so that I could easily search through one page instead of the then 22 pages.

At first I thought I could get a free software online that would do just that and lucky enough I did get HTML Merge from SourceForge. However, my luck did not last that long on account of this software not living up to this task: it refused these particular HTML pages on account of them being in an unsupported encoding and then forgot to mention what it supported.

So I tried saving a few of them in what I thought was the standard (UTF-8) but that threw me the same exact error.

Left with no option I decided to go the manual route: open each HTML individually then use the godsend that is copy and paste. Having gotten through some few pages is when I recalled that Notepad++ had once aided me not long ago to combine multiple plain text files. So what about HTML? Turned out it could handle those too.

Merging HTMLs using Combine Plugin

Note:

  • When I say combine or merge, I mean just that: appending one file after the other with no kind of HTML tag editing whatsoever. 
  • A less ambiguous though unpopular term for this I believe is concatenating. As such I wouldn’t advise using this method for content you plan publishing on a website. However, for offline HTML documents from the same source (like a book) I don’t see the harm.

1. Open Notepad++ first. You can get the portable or installable version here.

2. Now we need to install a plugin called Combine (previously called NPP Combine) for this to work. You can do that in either two ways:

a. While connected to the Internet, go to Plugins in the menu and under Plugin Manager select Show Plugin Manager. The plugin manager will automatically fetch all available plugins and list them there. Look for and select Combine then hit the Install button.

b. Get the plugin manually from the developers page and install it. To install, just copy the downloaded file (combine.dll) in the plugins sub-folder located inside Notepad++ installation folder. Restart the program to load the plugin.

3. Open all the HTML files you need to merge using Notepad++. To do this the easy way, just select all of them from your file manager then drag and drop them inside Notepad++ window.

4. Now go to the Plugins menu and select Start under the Combine plugin.

combine plugin
Start the Combine Plugin

That will launch the plugins window with some few settings. Since this is a HTML I don’t think it’s wise to add anything so just hit the OK button.

npp combine window
Configure the combine options

5. Doing that will combine all the opened files into one large file in the order they’ve been opened (i.e. from the first to the last tab). To finish, save this new file and you’re done.

You can now go ahead and open the merged HTML page with your browser to see the output. If you need to remove any repeated element from the pages (like images or navigation linking to other pages that are now non-existent), just open the merged file using Notepad++ and use the Replace function (Ctrl+H) to remove the elements in one go.

After that, if it’s a book like in my case, I presume you’d like to convert the merged HTML into a more portable format like PDF or Word if you wish to edit the content.

Exporting the HTML to Other Formats

1. HTML to PDF

For PDF, I would recommend opening the HTML file using Chrome Browser and using it’s superb export to PDF feature which also offers some neat customizations.

If you’re on Windows 8/10, you can also use Windows in-built PDF printer to export to PDF from any Browser. There are also plenty of free software and online services that can help you with that.

2. HTML to WORD

For Word, the good news is that pretty much any MS Word version handles HTML files by default.  MS Word actually renders the actual HTML rather than displaying its raw output.

So just open the file using MS Word then save the document in an editable Word Format (*docx, *.doc).

Tags:
Share:

14 Comments

  1. I had 120 HTML files in an export from an archived Basecamp project. These steps made it so easy to combine everything for easy scrolling/searching. Many thanks!

  2. FYI, I’m seeing a lot of the article images and graphics as “broken.” I’m using a current installation of Brave on Win10.

    Example URL: https://www.journeybytes.com/wp-content/uploads/2017/07/2017-07-0616_15_19-NPPCombine1.03.png

    Result: Error 522 from Cloudflare. “If you’re the owner of this website:
    Contact your hosting provider letting them know your web server is not completing requests. An Error 522 means that the request was able to connect to your web server, but that the request didn’t finish.”

    1. Kelvin Administrator

      Hello JK,
      Thanks a lot for letting me know, I’ll look into it. I had a server change recently and its been anything but smooth.

  3. Hi,
    I tried the HTML merge using Notepad ++ as suggested. When the combine completed, I had a .TXT file, not HTML. I saw no way to use Save As to get a combined HTML file,
    Please advise.
    Thanks,
    Gary

    1. Kelvin Administrator

      Hi Gary,
      When the combine is complete, it creates a file with no format. It’s on saving the file that you should select the Hyper Text Markup Language file (*.html, *.htm… ) from the drop down list. Both Save and Save As… should work. Just tested with the latest release (7.9.1) Let me know if you still can’t save the file.

    1. Kelvin Administrator

      Hey Stephen,
      Sorry about that, they did change the name. It’s now simply called Combine. Will update the article to reflect the change.

Leave a Reply

Feel free to share your comments or questions with me. I may not be able to respond immediately so please check later once I've approved your comment.

Your email address will not be published. Required fields are marked *

Kelvin Kathia

Kelvin Kathia is a writer that's passionate about sharing solutions to everyday tech problems. He's the founder and editor of Journey Bytes, a tech blog and web design agency. Feel free to leave him comments or questions regarding this post, or by leaving him a message on the contact page. If you found his content helpful, a donation is much appreciated.