regula.tools
100% Client-SideConverters

RFC 4648 §5 Base64URL Encoder & Decoder

Pre-configured in URL-Safe Base64URL mode (`RFC 4648 Section 5`), this converter replaces `+` with `-`, `/` with `_`, and strips `=` padding so encoded payloads travel safely inside URLs, JWT segments, and OAuth 2.0 PKCE challenges without extra percent-encoding.

Loading workspace...

#How to Use This Tool

1URL-Safe (Base64URL) mode is pre-enabled automatically.
2Paste UTF-8 JSON/text to encode to Base64URL, or switch to Decode to inspect JWT/PKCE segments.
3Copy the unpadded Base64URL output or share via Mode B compressed hash.

#Mathematical Formula & Standards

Standard Base64 uses `+` (index 62), `/` (index 63), and `=` padding—all reserved characters in RFC 3986 URLs. Base64URL (`RFC 4648 §5`) substitutes `-` (`0x2D`) for `+`, `_` (`0x5F`) for `/`, and omits trailing `=` padding, making every output character unreserved in URLs and filenames.

#Edge Cases & Technical Considerations

JWT & OAuth 2.0 PKCE Compatibility

JSON Web Tokens (`header.payload.signature`) and OAuth 2.0 PKCE `S256` challenges (`BASE64URL(SHA256(verifier))`) strictly require unpadded Base64URL (`-` and `_`), rejecting standard Base64 `+`, `/`, or `=`.

Full UTF-8 Multibyte Safety

Inputs are converted via `TextEncoder` UTF-8 bytes before Base64URL mapping so emojis and non-ASCII scripts encode without `btoa()` Latin1 errors.

#Frequently Asked Questions

Q:What is the difference between Base64 and Base64URL?

Base64URL (RFC 4648 §5) replaces `+` with `-`, `/` with `_`, and omits `=` padding so the string can be placed directly in URL query parameters, paths, and JWTs.

Q:Are my JWT payloads or tokens sent to a server?

Never. Encoding and decoding run 100% locally in your browser.

Have feedback or feature requests?

Help us improve this utility. Share suggestions, report edge cases, or request new features directly.

Send Feedback