Base64URL Encoder - Convert to URL-Safe Base64
Encode text or files to URL-safe Base64 (Base64url) with the RFC 4648 section 5 alphabet and no padding.
How to Use Base64 URL Encoder - Step by Step Guide
Input Your Text
Enter the text you want to encode into URL-safe Base64 format. This encoding is essential for JWT tokens and web APIs:
Example: Input Text
Here's an example input text:
Hello World! Testing +/= characters
Automatic Encoding
The tool automatically converts your text to URL-safe Base64 format as you type:
Example: Standard vs URL-Safe Base64
Standard Base64 (NOT URL-safe):
SGVsbG8gV29ybGQhIFRlc3RpbmcgKy89IGNoYXJhY3RlcnM=
Contains = padding, unsafe for URLs
URL-Safe Base64 (Base64url):
SGVsbG8gV29ybGQhIFRlc3RpbmcgKy89IGNoYXJhY3RlcnM
No padding, safe for URLs and filenames
Copy or Download Result
Get your encoded Base64url string ready for use:
What is Base64 URL-Safe Encoding?
Base64 URL encoding (Base64url) is a URL-safe variant of standard Base64 encoding that replaces URL-unsafe characters with alternatives that can be safely used in URLs, filenames, and HTTP headers. This encoding standard is defined in RFC 4648 Section 5.
Key Differences:
Common Use Cases for Base64url
Base64url encoding is essential for modern web development and is used extensively in:
Frequently Asked Questions
What is the difference between Base64 and Base64url?
Only three characters. Base64url writes - where Base64 writes +, _ where it writes /, and drops the = padding at the end. The bytes underneath are the same, so José 😀 is Sm9zw6kg8J+YgA== in plain Base64 and Sm9zw6kg8J-YgA here. If you need the classic alphabet with padding, use the Base64 Encoder instead.
When should I use URL-safe Base64?
Whenever the encoded value ends up in a URL path or query string, a cookie, a file name or a JWT. In those places + can turn into a space, / looks like a path separator and = has to be escaped, so the plain alphabet tends to break in quiet ways.
Can I get it back again, and does the missing padding matter?
Yes, it decodes back to exactly the bytes you put in. Most decoders, including Node's Buffer.from(value, 'base64url') and Python's base64.urlsafe_b64decode once you add the = back, work out the length from the string itself. To check a result, paste it into the Base64URL Decoder.
Does this produce the same header and payload as jwt.io?
For the same bytes, yes. A JWT header is the Base64url of its JSON text, so {"alg":"HS256","typ":"JWT"} typed exactly like that gives eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9, the familiar start of most tokens. Spaces and line breaks count, though: pretty-printed JSON gives a different string. This page only encodes; it does not sign anything, so it will not make the third part of a token.
What happens with accents, emoji and uploaded files?
Text is converted to UTF-8 before encoding, which is what JWT libraries and most servers expect, so accents, emoji and other scripts decode back correctly. An uploaded file is encoded from its raw bytes, so an image or a file with a byte order mark comes out exactly as it is on disk.
Is Base64url safer than regular Base64, and does my data leave the browser?
It is not safer. Base64url is an encoding, not encryption, and anyone can decode it in a second, so don't use it to hide passwords or keys. The encoding itself runs in your browser and nothing you type or upload is sent to our server. Very large inputs can get slow, because the result has to fit in the editor.
Related Tools
Base64 Encoder
Encode text and data to Base64 format
Base64 Decoder
Decode Base64 encoded data back to text
Base64 Validator
Validate Base64 encoded strings with detailed format checking and content type detection
Base64 URL Decoder
Decode URL-safe Base64 strings from JWT tokens, OAuth responses, and API data
URL Encode
Encode text and URLs for safe transmission
JSON URL Encode
URL encode JSON data for query parameters