Developer Utilities

URL-safe Base64

All tools

Convert Base64 to base64url and back, so tokens survive in URLs, cookies and file names.

How it works

Four simple steps

1

Pick a direction

Standard to URL-safe, or URL-safe back to standard Base64.

2

Paste the string

Whitespace is ignored when converting to the URL-safe form.

3

Characters are mapped

+ and / swap with - and _, and = padding is removed or restored.

4

Copy the result

Copy it into your URL, cookie or decoder, or download it.

URL-safe Base64

About URL-safe Base64

A signed download link breaks whenever its token happens to contain a + sign, because the server reads it as a space. The fix is base64url, the variant that JWTs and many signed-URL schemes use. This converter switches a string between the two forms in either direction.

Pick a direction with the radio buttons. Standard to URL-safe replaces + with -, / with _, and strips trailing = padding; whitespace in the input is removed first. URL-safe to standard does the reverse and adds = characters until the length is a multiple of four, which strict decoders like atob and many server libraries require. The conversion is pure character mapping, so the underlying bytes never change.

The tool does not encode or decode content itself. Start from text with the UTF-8 Base64 encoder, convert here, and you have a value that is safe in a query string. If you only need to read the first two segments of a token, the JWT claims viewer handles base64url directly. The article on decoding JWTs without cloud debuggers explains why that matters for production tokens.

Everything here is string replacement in this tab, so signed tokens and keys you paste are not transmitted.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

No. Percent-encoding turns + into %2B and / into %2F, which works but makes the value longer and easy to double-encode. Base64url swaps those characters for - and _, which need no escaping at all.

RFC 7515 says JWTs omit it, and most base64url producers do the same. Some decoders still insist on padding, which is why the reverse direction adds it back automatically.

Not strictly. It maps characters without validating them, so a typo passes straight through. Run the result through the Base64 Validator if you are unsure the string is intact.

View more FAQs

Related tools

View all

Cron Calendar

Explain cron expressions and preview the next run times in any timezone.

Open

CSV to SQL

Infer column types and generate CREATE TABLE + INSERT statements from CSV.

Open

SQL Query Builder

Build SELECT queries visually and reverse-parse SQL into a structure tree.

Open

Log Pattern Miner

Cluster log lines into templates, surface anomalies, and mask PII locally.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools