Base64 Encoded String
intermediateMatches base64 encoded strings.
base64encodingdatavalidation
Pattern
/(?:[A-Za-z0-9+/]{4})+(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?|[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=/gTry It
0 of 6 strings matched
Explanation
Matches base64 encoding: groups of 4 base64 characters, with optional padding (= or ==) at the end. Validates proper padding alignment.
Test Strings
Matching
- SGVsbG8gV29ybGQ=
- dGVzdA==
- YWJjZGVmZw==
Non-matching
- !@#$
- ====
- <<>>
Language Compatibility
| Language | Support |
|---|---|
| JS | Full support |
| PYTHON | Full support |
| JAVA | Full support |
| PHP | Full support |
| GO | Full support |
Code Snippets
const regex = /(?:[A-Za-z0-9+\/]{4})+(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?|[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=/g;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);Common Variations
URL-safe base64
[A-Za-z0-9_-]+Matches base64url encoding (no + / =)