Base64 ⇄ Base64url Converter

Convert standard Base64 to URL-safe Base64url and back — swap +/ for -_, handle = padding, auto-detect the direction. Runs entirely in your browser, no server, no sign-up.

Try:
Result

What this tool does

Convert a standard Base64 string into URL-safe Base64url and back, right in your browser. Nothing is uploaded — it runs locally, works offline, and needs no sign-up. This is a pure alphabet transform: it swaps the two characters that differ between the alphabets and applies a padding rule. It does not decode Base64 to plain text.

Standard Base64 uses + and /, which have special meaning in URLs, filenames, and JWTs. Base64url replaces them with - and _ and usually drops the = padding, so the value can be dropped straight into a query string, path segment, cookie, or filename.

Char 62Char 63Padding
Standard Base64+/= (kept)
URL-safe Base64url-_usually dropped

Direction

DirectionWhat it does
auto (default)If the input already contains - or _ it is treated as Base64url and converted to standard; otherwise it is treated as standard Base64 and converted to URL-safe Base64url.
to-urlForce standard → URL-safe (+-, /_).
to-standardForce URL-safe → standard (-+, _/).

Padding

PaddingWhat it does
auto (default)Pads standard output with =, leaves Base64url output unpadded — each alphabet's canonical form.
keepAlways pad the output to a length that is a multiple of 4.
stripRemove all = padding from the output.

Turn on Validate input is real Base64 to reject a malformed string (wrong length or stray characters) instead of silently transforming it.

Examples

InputSettingsOutput
c3ViamVjdHM/X2Q9MQ==to-url · auto paddingc3ViamVjdHM_X2Q9MQ
c3ViamVjdHM_X2Q9MQto-standard · auto paddingc3ViamVjdHM/X2Q9MQ==
+/+/auto-_-_
c3ViamVjdHM/X2Q9MQ==to-url · keep paddingc3ViamVjdHM_X2Q9MQ==
eyJhbGciOiJIUzI1NiJ9autoeyJhbGciOiJIUzI1NiJ9

In the last row the JWT-style token has no +, /, -, or _, so both alphabets agree and only the padding could differ.

Limits & edge cases

FAQ

What is the difference between Base64 and Base64url?

They encode the same bytes but use two different characters for the last two symbols of the alphabet. Standard Base64 uses + and /; URL-safe Base64url uses - and _ so the value is safe inside URLs, filenames, and JWTs, and it usually omits the = padding.

Does this decode my Base64 to text?

No. It only converts between the two Base64 alphabets and adjusts padding — the output is still Base64, just URL-safe (or standard). To recover the original bytes or text you need a Base64 decoder instead.

Why did the padding disappear?

With the default auto padding, URL-safe Base64url output is left unpadded because that is its canonical form (and how JWTs are written). Choose keep if the system you are targeting still expects trailing = characters.

How does auto-detect decide the direction?

It looks for the URL-safe markers - and _. If either is present the input is assumed to be Base64url and converted to standard; otherwise it is assumed to be standard Base64 and converted to URL-safe. Set the direction explicitly if your input is ambiguous.

Can I paste a whole JWT?

Convert one segment at a time. A JWT is dot-separated Base64url parts (header.payload.signature); the . separator is not part of the Base64 alphabet, so paste an individual segment rather than the entire token.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool base64url-converter "c3ViamVjdHM/X2Q9MQ=="

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/base64url-converter/?text=c3ViamVjdHM%2FX2Q9MQ%3D%3D&direction=auto&padding=auto&validate=true

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.