What is Base64URL Tool?
Base64URL is a modification of the standard Base64 encoding scheme, designed to be safe for use in URLs and filenames. Standard Base64 uses characters '+' and '/', which have special meanings in URLs and file systems. Base64URL replaces '+' with '-' (minus) and '/' with '_' (underscore), and typically omits the padding '=' characters. This makes it ideal for encoding binary data (like digital signatures or tokens) that needs to be passed in URL query parameters without requiring percent-encoding. It is the standard encoding used for JSON Web Tokens (JWT).
Input Formats
- Base64URL strings
- Standard Base64 strings
- Plain text
Output Results
- Base64URL string (no padding)
- Decoded text
- Copy-ready result
Key Features
Who is this for?
JWT Handling
Developers manually encoding or decoding parts of a JSON Web Token.
URL Parameters
Passing binary data or complex strings in URLs without breaking the link structure.
Filename Encoding
Encoding arbitrary data to be used as a safe filename.
How to Use
Paste your text or Base64URL string.
Select 'Encode' to convert to Base64URL.
Select 'Decode' to convert back to text.
Copy the result.
Examples
Input
Hello World!Output
SGVsbG8gV29ybGQhCommon Errors
- Confusing Base64 with Base64URL
- Expecting padding '=' (Base64URL often omits it)
- Decoding binary data as text (results in garbage)
Code Examples
JavaScript
function base64UrlEncode(str) {
return btoa(str)
.replace(/\+/g, '-')
.replace(/\//g, '_')
.replace(/=+$/, '');
}