Base64URL Encoder

Characters—
Input check—

How Base64URL Encoder is calculated: Standard Base64, then replace '+' with '-', '/' with '_', and drop the '=' padding. Decoding adds the padding back before converting.

What is a Base64URL Encoder?

Base64URL is Base64 made safe for URLs: the '+' and '/' characters are swapped for '-' and '_', and the '=' padding is dropped. It is the encoding used inside JWTs, and anywhere a token has to survive in a link. It works entirely in your browser: you type or paste text, and the result appears at once, with nothing uploaded and nothing stored. People searching for a base64url encoder usually want exactly that — a quick answer without an account, a download, or a wait.

Developers building login flows and APIs, anyone debugging a JWT by hand, and testers who need to pass a token in a URL without it breaking. Students use it for homework and puzzles, developers use it at work, and writers use it when a deadline is close. The common thread is simple: the job is small, the answer should be instant, and the text should stay private.

This page keeps that promise. The base64URL Encoder runs on your own device, so your words never leave the tab. You can use it as often as you like, on any text, and close the page knowing nothing was saved anywhere — there is no history, no log, and no sign-up standing between you and the answer.

If you have never used a tool like this before, start with the example on this page and change one thing at a time — one word, one setting — and watch the result change. That is the fastest way to learn what each input does, and it works for every tool in this family, because they all follow the same pattern: text in, result out, nothing saved.

How a Base64URL Encoder works

The text is first turned into UTF-8 bytes, then encoded exactly like standard Base64 — three bytes become four characters from the 64-letter alphabet. Then the URL-unsafe characters are replaced: '+' becomes '-', '/' becomes '_', and trailing '=' padding is removed. Decoding reverses the replacements, restores the padding, and converts the bytes back to text. The rule this page uses is: Standard Base64, then replace '+' with '-', '/' with '_', and drop the '=' padding. Decoding adds the padding back before converting.

Base64URL is not encryption: anyone can decode it, so it only hides text from casual readers. It also grows the data by about a third, so it is a poor way to store large text and a good way to carry small tokens safely.

Because the rule never changes, the same input always gives the same output. Run the example below twice and the result will match exactly, character for character. That predictability is what makes the tool useful for checking your own work. For a different kind of text job, the URL encoder decoder covers the next step once you have your result. The comparison section further down this page explains which of the two fits which job, so you can pick before you paste.

The rule above is the whole method — there is no hidden step and no second pass. What you see in the rule is what the tool computes, which is why the worked example below can be followed by hand, one step at a time, with a pencil if you like.

The text you feed it

Any text works, including accented letters and emoji, because the input is converted to UTF-8 bytes first. When decoding, the input must use only the URL-safe alphabet — letters, digits, '-' and '_' — and a '+' or '/' in the input marks it as standard Base64, not Base64URL.

'Hello, World!' encodes to 'SGVsbG8sIFdvcmxkIQ'. Standard Base64 would give 'SGVsbG8sIFdvcmxkIQ==' with two padding characters, and Base64URL drops them. The output is 20 characters for 13 bytes of input.

If you are decoding a JWT, paste only one segment — the header, the payload, or the signature — not the whole token with its dots. Each segment is a separate Base64URL string.

When in doubt, try the worked example below first — it uses the page defaults, so it shows the tool working exactly as it ships.

Paste from anywhere — a document, a chat, a web page. The tool reads only the text you give it, so stray formatting, links, and images are left behind. If the pasted text looks odd, paste it as plain text first and then copy it in, so nothing invisible rides along.

A worked example

Take this input: 'Hello, World!'. The 13 bytes are grouped in threes and each group becomes four Base64 characters. The '+' and '/' replacements do not trigger here, and the two '=' padding characters at the end are dropped. The result is 'SGVsbG8sIFdvcmxkIQ' — 20 characters, with the input check reading 'Valid input'.

Decode 'SGVsbG8sIFdvcmxkIQ' and you get 'Hello, World!' back. The padding is restored automatically: 20 characters is a multiple of 4 already, so no padding is needed for this one.

Try '?': a single byte encodes to 'Pw' in Base64URL — standard Base64 would give 'Pw=='. Short inputs show the padding rule most clearly, because the padding is a larger share of the output.

You can check the result yourself without trusting the page. Reverse the operation — decrypt what you encrypted, or run the output back through the tool with the opposite setting — and the original input should come back. If it does not, the first thing to check is the input: a missing letter, an extra space, or a setting that changed between the two runs.

Who uses a Base64URL Encoder — and why

A developer copies the payload segment of a JWT into this tool to read the claims inside it while debugging a login flow. It is the kind of job that comes up often enough to remember, and rarely enough to justify installing anything for.

An API tester builds a URL with a token in the query string and encodes the token first, so the link does not break on a '+' or '/'. The ASCII converter is the natural next stop when the result needs a different treatment. It answers the question this page leaves open, so the two together cover the whole job.

A student compares Base64 and Base64URL side by side to see exactly which characters change and why.

Base64URL Encoder vs Base64 Encoder Decoder

The standard Base64 encoder decoder uses '+' and '/' with '=' padding, while this tool uses the URL-safe variant. The two encodings hold the same bytes; only the alphabet differs. The base64 encoder decoder is the closest comparison on this site, and the two answer different questions. Both are free, both run in your browser, and neither asks for an account.

Pick the base64URL Encoder when the output goes into a URL, a JWT, a filename, or anywhere '+' and '/' would break things. Pick the base64 encoder decoder when the output goes into a data field, an email, or a system that expects classic Base64 with padding.

In practice most people keep both bookmarked. They are small, free, and private, and switching between them costs nothing — paste the same text into each and compare the outputs side by side before deciding which one fits the job in front of you. The habit that saves the most time is deciding the job first and the tool second: once you know whether you need a cipher, a conversion, or a count, the choice between two similar tools is usually obvious.

Common mistakes with a Base64URL Encoder

Pasting a whole JWT with its dots. The token has three Base64URL segments separated by dots, and decoding the whole thing at once fails — decode one segment at a time.

Adding the padding back by hand. The tool restores it automatically, so pasting 'SGVsbG8sIFdvcmxkIQ==' works, but it is not needed.

Treating Base64URL as encryption. It is an encoding, not a cipher — anyone can decode it, so never put a password or a secret in it. Mixing the two alphabets. A '+' in the input means standard Base64, and this tool will flag it as invalid Base64URL — switch tools instead of editing the string. The fix in every case is the same: check the input, check the setting, and test with the worked example before trusting a long result.

If the result still looks wrong after checking the input, run the worked example exactly as written. If the example works and your input does not, the difference is in your input — compare them character by character, including spaces, until the odd one out shows itself.

How to use this Base64URL Encoder

Type or paste your text, choose Encode or Decode, and copy the result. Encoding gives a URL-safe string with no padding; decoding restores the original text. The JSON formatter can help with the next step once you have your output.

When a token looks almost right but will not decode, check for a missing character at the end — Base64URL strings are often truncated by chat apps and email clients that wrap long lines.

The result can be copied with the buttons above it, or shared and printed from the actions on the page. If you use the tool often, bookmark the page — the address never changes, and your last input is not saved, so a fresh visit always starts clean. That also means there is nothing to clear and nothing to log out of when you are done.

Everything on this page is free, with no account and no limit on how often you use it. Your text is processed in your browser and never sent to a server, so drafts, names, and private notes stay on your device. If the result looks wrong, check the input first — a stray space or a missing character is the cause far more often than the tool itself.

Frequently Asked Questions

Base64URL replaces '+' with '-' and '/' with '_', and drops the '=' padding. The change makes the output safe in URLs, filenames, and JWTs, where '+' and '/' would be misread.

The '=' padding is only needed to mark the length, and a decoder can work it out from the string length alone. Dropping it keeps tokens shorter and avoids problems in URLs, where '=' has a special meaning.

Yes, one segment at a time. A JWT has three Base64URL segments separated by dots — header, payload, and signature. Paste the payload segment to read the claims inside it.

No. It is an encoding, not encryption. Anyone can decode Base64URL text, so it only makes data safe to transport, never secret.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.