Notepad++ is already the king of text editors on Windows. It rivals Visual Studio Code in popularity, used by 34.2% of respondents in the 2018 Stack Overflow developer survey. Notepad++ is not only free, open source but also simple, lightweight, and extendable.
Despite using Linux on a daily basis, sometimes I do work on Windows machines. Whenever I need to edit source code, or simply a text file, Notepad++ is my editor of choice. All sorts of advanced editing like removing blank lines from a text file or search and replace with carriage return character feels as easy as I'm on Linux.
In rare cases, you will need to view/edit really big files. For your information, Notepad++ can't handle big text files that well and will show you a "File too big" pop-up instead of the file contents.
In this article, I will show you what to do when you encounter "File too big" error in Notepad++.
What does "File too big" really means?
Notepad++ cannot open files that are larger than 2GB. "File too big to be opened by Notepad++" simply means Notepad++ has hit its limit and cannot process the the any further.
At the heart of Notepad++ is Scintilla - an open source library that provides the text editing components. In order to provide rich text viewing, alongside code folding, syntax highlighting, etc, Notepad++ needs to load the whole file into RAM and may requires as many as four times more memory than the file size.
That explains why sometimes you will see stutters and lags while editing files that weight a few megabytes on a low-memory machine. It's just the system running out of memory.
Split the text file into digestible chunks
Since the file is too big to be opened by Notepad++, we can try splitting it into smaller, digestible chunks. On Windows, this can be achieved by using PowerShell commands.
You can use the pre-made PowerShell script made by Eric Wright at https://gist.github.com/discoposse/1251006.
To make use of the script, save it to disk and name it SplitLogs.ps1 in the same folder as your text file.
Then you need to open an elevated PowerShell window and run SplitLogs.ps1. Follow the prompts and give the script information to complete the process.
Use text viewer designed for big files
If you only need to view the file, try one of these read-only text viewer that supports huge files by design.
- klogg (Windows, macOS, Linux) - a community-maintained fork of glogg. Ugly interface, but gets the job done.
- Large Text File Viewer (Windows) - free, tiny size and lightning fast, supports theming, split view and even regex search
- Lister (Windows) - portable, very small footprint and minimal interface. It supports regex search, printing, hex mode, and more. Lister comes from Ghisler - the creator of Total Commander.
Notepad++ alternative for large files
If you need to edit the file, we recommend you switch to another text editor. The new text editor may not be as feature-rich as Notepad++, but at least they are able to open several-gigabyte-sized file without breaking a sweat.
Below is a list of free Notepad++ alternatives for large files.
- PilotEdit Lite (Windows) - Edit 10GB+ files, compare huge files, regex search, slow start-up but very low memory usage, accurate progress bar. I was able to open and edit a 8GB SQL dump without breaking any sweat.
- BssEditor (Windows) - Support large files and very long lines, regular search and regex search, bookmarks, multiple file views, unlimited Undo/Redo.
- EditPad Lite (Windows) - Able to edit GBs-sized files with full Unicode support, tabbed interface, unlimited undo and redo, automatic backup and regex search. It loads the files into memory so prepare your RAM.
- Large File Editor (Windows) – Opens and edits TB+ files, supports Unicode, uses little memory, has XML-specific features, and includes a binary mode.
- GigaEdit (Windows) – Supports searching, character statistics, and font customization. But it's buggy – with large files, it only allows overwriting characters, not inserting them; it doesn't respect LF as a line terminator, only CRLF; and it's slow.