Notepad++ is the favourite editor of many Windows developers, and with a few regular expressions it becomes a handy Base64 checker, especially for large values that are awkward to paste into a website.
1. Find invalid characters
Open Search → Find (Ctrl+F), choose Search Mode: Regular expression, and search for:
[^A-Za-z0-9+/=\r\n]
Every match is a character that does not belong in standard Base64. Use Find All in Current Document to list them with line numbers. For Base64URL use [^A-Za-z0-9\-_=\r\n].
2. Check that “=” only appears at the end
=[^=\r\n]
Any match means padding was found in the middle of the value — usually two values were concatenated.
3. Remove line breaks
Many decoders reject line breaks. Replace (Ctrl+H) with regular expressions:
- Find:
\R(any line ending) - Replace with: (empty)
4. Validate the whole value
Select everything and search for this regex (single line, no breaks):
^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
If the whole text is matched, the value is valid standard Base64. If not, the length or padding is wrong.
5. Encode and decode inside Notepad++
The MIME Tools plugin (installed by default in most versions, otherwise via Plugins → Plugins Admin) adds Plugins → MIME Tools → Base64 Encode / Base64 Decode. Select text and run the command. Note that it treats the text in the document’s current encoding, so set Encoding → UTF-8 first for non-English text.
When regex is not enough
Regular expressions cannot tell you where a value was cut off or whether the decoded data is a valid image. For that, use the online validator (shows positions of all problems), the repair tool, and the Base64 to File decoder (identifies the file type).
Comments (0)
Questions, ideas or a bug in “Validate Base64 using Notepad++”? Leave a comment, rate the tool, or reply to others.
No comments yet. Be the first to share your feedback!