AI Tools Free

Base64 URL Encoder Decoder

Paste UTF-8 text or a URL-safe token into the Base64 URL Encoder Decoder below to convert between plain text and RFC 4648 Section 5 Base64URL with configurable '=' padding.

Free to useNo sign-upRuns in your browser
Enter your details

Enter the inputs, then select Run Base64URL.

Choose whether to encode plain text or decode a Base64URL token.

Input text or Base64URL payload.

Control whether trailing '=' characters are stripped when encoding.

Your result
Enter your details

Result will appear here

How Base64 URL Encoder Decoder works

The Base64 URL Encoder Decoder converts your input string into a UTF-8 byte array, encodes 24-bit groups into 6-bit symbols using the URL-safe alphabet (A-Z, a-z, 0-9, '-', '_'), and either strips or preserves '=' padding.

Index 62: '+' -> '-'; Index 63: '/' -> '_'; Unpadded length = ceil(UTF8_bytes * 4 / 3).

Side-by-side cards show both the Base64URL string and the standard Base64 equivalent so you can spot exactly which characters were substituted.

Base64 URL Encoder Decoder workflow overview
Workflow overview for Base64 URL Encoder Decoder.

Base64 URL Encoder Decoder Quick Reference & Input Guide

Review the input parameters, allowed value ranges, and worked reference cases for the Base64 URL Encoder Decoder below before running your calculation.

Parameter / ScenarioDefault / Sample ValueRule or Allowed RangeOutput / Usage Note
Input: Operation modeencodeOptions: Encode UTF-8 text -> Base64URL, Decode Base64URL -> UTF-8 textRequired workspace parameter
Input: Input stringhttps://aitoolsfree.net/tools/?q=...Input text or Base64URL payload.Required workspace parameter
Input: Padding ('=') policy when encodingunpaddedOptions: Omit '=' padding (RFC 7515 JWT / URL-safe default), Keep '=' padding (4-character block alignment)Required workspace parameter
Worked Case 1: Encoding a URL with query parameters (46 UTF-8 bytes)Preloaded / test valuesBase64URL(bytes) = StandardBase64(UTF8(text)).replace('+', '-').replace('/', '_').rstrip('=')Encoding 'https://aitoolsfree.net/tools/?q=a+b&mode=full' yields 62 unpadded Base64URL characters ('aHR0cHM6Ly9haXRvb2xzZnJlZS5uZXQvdG9vbHMvP3E9YStiJm1vZGU9ZnVsbA') vs. 64 padded characters ending in '=='.
Worked Case 2: Decoding an unpadded JWT payload segmentPreloaded / test valuesBase64URL(bytes) = StandardBase64(UTF8(text)).replace('+', '-').replace('/', '_').rstrip('=')Switching to Decode mode and pasting 'eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIn0' restores the missing '=' padding and outputs '{"sub":"1234567890","name":"John Doe"}'.

How to use Base64 URL Encoder Decoder step by step

Encode URL parameters, OAuth state strings, or decode JWT header/payload segments locally.

Select Encode or Decode mode

Pick 'Encode UTF-8 text -> Base64URL' or 'Decode Base64URL -> UTF-8 text'.

Base64 URL Encoder Decoder step 1: Select Encode or Decode mode
Step 1 workflow overview for Base64 URL Encoder Decoder.

Paste your UTF-8 string or Base64URL token

Paste the raw text, JSON object, or URL-safe Base64 token into the input box.

Base64 URL Encoder Decoder step 2: Paste your UTF-8 string or Base64URL token
Step 2 workflow overview for Base64 URL Encoder Decoder.

Choose padding policy and copy the result

Select Omit '=' padding (standard for JWTs and URLs) or Keep '=' padding, then click Run Base64URL.

Base64 URL Encoder Decoder step 3: Choose padding policy and copy the result
Step 3 workflow overview for Base64 URL Encoder Decoder.

Worked examples for Base64 URL Encoder Decoder

See how URL query strings and JWT payloads convert cleanly without percent-encoding issues.

Encoding a URL with query parameters (46 UTF-8 bytes)

Encoding 'https://aitoolsfree.net/tools/?q=a+b&mode=full' yields 62 unpadded Base64URL characters ('aHR0cHM6Ly9haXRvb2xzZnJlZS5uZXQvdG9vbHMvP3E9YStiJm1vZGU9ZnVsbA') vs. 64 padded characters ending in '=='.

Base64 URL Encoder Decoder example 1: Encoding a URL with query parameters (46 UTF-8 bytes)
Worked example 1 for Base64 URL Encoder Decoder.

Decoding an unpadded JWT payload segment

Switching to Decode mode and pasting 'eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIn0' restores the missing '=' padding and outputs '{"sub":"1234567890","name":"John Doe"}'.

Base64 URL Encoder Decoder example 2: Decoding an unpadded JWT payload segment
Worked example 2 for Base64 URL Encoder Decoder.

Inspecting '+' and '/' substitutions

The breakdown cards count how many '+' and '/' symbols from standard Base64 were replaced with '-' and '_' in Base64URL.

Base64 URL Encoder Decoder example 3: Inspecting '+' and '/' substitutions
Worked example 3 for Base64 URL Encoder Decoder.

How to interpret the Base64 URL Encoder Decoder output

Compare the unpadded Base64URL output, padded Base64URL output, and standard Base64 output.

The main result displays the converted string. Breakdown cards report UTF-8 byte length, output character length, padding characters stripped/restored, and URL-safe symbol replacements ('-' and '_').

How to interpret Base64 URL Encoder Decoder results
Result interpretation guide for Base64 URL Encoder Decoder.

Input limits, assumptions, and related tools

Verify character validity and encryption vs. encoding boundaries.

Base64URL is an encoding scheme, not encryption; anyone can decode a Base64URL string without a key. In Decode mode, inputs with length % 4 == 1 or characters outside [A-Za-z0-9-_+/=] are rejected with a validation error.

Scope limits and assumptions for Base64 URL Encoder Decoder
Assumptions and input boundaries for Base64 URL Encoder Decoder.

Base64 URL Encoder Decoder: common questions

Answers about using Base64 URL Encoder Decoder and understanding its results.

How does Base64URL differ from standard Base64?

Standard Base64 (RFC 4648 Section 4) uses '+' at index 62, '/' at index 63, and '=' for padding, all of which have special meanings in URLs and filenames. Base64URL (Section 5) replaces '+' with '-' (hyphen) and '/' with '_' (underscore), and typically omits trailing '=' padding.

Why do JWTs (JSON Web Tokens) use unpadded Base64URL?

RFC 7515 (JSON Web Signature) specifies unpadded Base64URL so tokens can be passed safely inside HTTP query parameters, Authorization headers, and URL paths without percent-encoding.

How does this tool handle multi-byte UTF-8 characters like emojis or accented letters?

Unlike window.btoa() alone, which throws an error on non-Latin1 characters, this tool encodes text to UTF-8 bytes via TextEncoder before applying the Base64URL alphabet, and decodes via TextDecoder('utf-8').

Can the decoder read a Base64URL string that has no '=' padding at the end?

Yes. In Decode mode, the parser automatically calculates the modulo-4 remainder (length % 4) and restores the required '=' padding before decoding.

Try your own values

Choose another tool for your next calculation, conversion, or text task.

Run Base64URL