URL Encode / Decode
Percent-encode text for URLs and query strings, or decode %XX sequences back to readable text.
Open URL Encode / Decode
Encode text to Base64 or decode Base64 back to text, with UTF-8 and URL-safe Base64URL support.
Encode with - and _ and no padding. Decoding accepts both forms.
This tool converts text to Base64 and Base64 back to text on one page. Pick a direction with the Encode to Base64 and Decode Base64 tabs, paste your input, and the result appears as you type. It is useful for building HTTP Basic auth headers, reading the payload of a JWT, checking a value stored in a config file, or embedding a short string in JSON or a data URL.
Text is converted to UTF-8 bytes before encoding, so accented letters, non-Latin scripts and emoji survive the round trip. The decoder accepts both standard Base64 and the URL-safe Base64URL alphabet, ignores whitespace and tolerates missing = padding. Everything runs locally in your browser.
Encode to Base64 to turn text into Base64, or Decode Base64 to turn Base64 back into text.Plain text box (encode) or the Base64 input box (decode). The output updates automatically after a short pause.URL-safe (Base64URL) to get - and _ instead of + and /, with no padding. In decode mode both forms are detected automatically.Base64 output or Decoded text. If the input cannot be decoded, an error message appears in red in the output panel.Copy output, or use Swap input and output to move the result into the input and flip the mode, which is a quick way to confirm the round trip.The 13 bytes of Hello, world! are not a multiple of 3, so the output ends with == padding.
Hello, world!SGVsbG8sIHdvcmxkIQ==With URL-safe (Base64URL) turned on, the last character is _ instead of /. With the switch off, the same input encodes to Q2Fmw6kg4piVIDIwMjY/. The é and the coffee emoji are encoded as their UTF-8 bytes.
Café ☕ 2026?Q2Fmw6kg4piVIDIwMjY_In Decode Base64 mode, the middle segment of a JWT decodes to its JSON claims. It is Base64URL without padding, and the decoder handles both without any switch.
eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkFkYSJ9{"sub":"1234567890","name":"Ada"}Base64 reads the input three bytes (24 bits) at a time and splits them into four 6-bit groups. Each group is written as one character from a 64-character alphabet: A-Z, a-z, 0-9, + and /. When the last group has only one or two bytes, the output is padded with == or = so its length stays a multiple of four.
Because every 3 bytes become 4 characters, Base64 output is about a third larger than the input. It is an encoding, not encryption or compression: anyone can decode it, and it does not hide or shrink anything. Use it to move bytes through systems that only accept text, never to protect secrets.
The + and / characters have special meanings in URLs and file paths, so RFC 4648 also defines a URL-safe alphabet that uses - and _ instead. JWTs, many OAuth parameters and some storage keys use this form, usually without = padding.
URL-safe (Base64URL) off, the encoder writes standard Base64 with +, / and padding, as used by MIME email, PEM files, data URLs and HTTP Basic auth.URL-safe (Base64URL) on, the encoder writes - and _ and removes trailing = characters.- and _ back to + and /, adds any missing padding, and decodes, so you can paste either form.Before decoding, all spaces, tabs and line breaks are removed. That means Base64 wrapped at 64 or 76 characters per line, as in PEM blocks and raw email source, decodes without cleanup. You can paste a PEM body, but leave out the -----BEGIN and -----END lines, which are not Base64.
If decoding fails, the output shows Invalid Base64 input, or the decoded bytes are not UTF-8 text. The common causes are characters outside both alphabets (such as @ or .), a truncated string whose length cannot be valid Base64, and Base64 that holds binary data such as an image, a PDF or gzip output. This tool decodes to text, and it refuses byte sequences that are not valid UTF-8 rather than showing garbled characters.
Developers run into Base64 in many places. A few quick tasks this page helps with:
username:password and send it as Authorization: Basic <value>. This is not a security measure on its own and must only travel over HTTPS.Encoding and decoding run entirely in your browser and nothing is sent to a server. The last input, the selected mode and the switch settings are saved in this browser's local storage so they are still there on your next visit. Click Clear input to remove the saved text, which is worth doing after decoding tokens or credentials on a shared computer.
More utilities that pair well with this one.
Percent-encode text for URLs and query strings, or decode %XX sequences back to readable text.
Open URL Encode / Decode
Decode JWT header, payload, and signature parts instantly.
Open JWT Decoder
Generate MD5, SHA-1, SHA-2, SHA-3, Keccak-256 and RIPEMD-160 hashes of text at once.
Open Hash Generator
Generate cryptographically secure secrets for env vars, Better Auth, NextAuth, JWT signing, and API keys.
Open Secret Key Generator
Common questions about this tool.
A-Z, a-z, 0-9, + and /), with = padding at the end. It lets binary data travel through text-only places such as JSON, XML, email bodies and data URLs.Encode to Base64 or Decode Base64 tab. The result updates as you type. Swap input and output moves the result into the input box and flips the mode, so you can encode a string and immediately decode it again to confirm the round trip.é, € or emoji encode correctly and decode back to the same text. When decoding, the bytes must form valid UTF-8, otherwise the tool shows an error instead of garbled characters.+ with - and / with _, and drops the = padding, so the result can sit in a URL, file name or JWT without escaping. Turn on URL-safe (Base64URL) when encoding for those uses. Decoding detects both alphabets automatically, so the switch does not matter in Decode Base64 mode.= characters pad the output to a multiple of 4 characters. The decoder also accepts strings with the padding removed.Invalid Base64 input, or the decoded bytes are not UTF-8 text. appears when the input contains characters outside the Base64 alphabets, has an impossible length, or decodes to binary data such as an image or compressed file. This tool decodes to text only.Clear input removes the saved text.