CraftTools

Base64 & URL Encoder / Decoder

Guide: Base64 Explained: What It Is and When to Use It

Nothing you enter or choose here leaves your device. This tool runs in your browser.

Two jobs in one tool

The switch at the top picks between Base64 and URL encoding. They look similar and do different things. Base64 turns any text into a string of 64 safe characters. URL encoding leaves normal text alone and replaces only the characters that would break a web address with a percent sign and two hex digits.

InputBase64URL encoding
Hello, World!SGVsbG8sIFdvcmxkIQ==Hello%2C%20World!
user:passdXNlcjpwYXNzuser%3Apass
caféY2Fmw6k=caf%C3%A9
a&b=cYSZiPWM=a%26b%3Dc

Use Base64 when you need to carry data through a place that accepts only plain text. Use URL encoding when you're putting a value inside a query string, such as a search term or a redirect address with its own question mark.

Everyday uses

  • Basic authentication. The header is Authorization: Basic followed by username:password in Base64. Encode user:pass and you get dXNlcjpwYXNz. Remember it's only encoded, so use it over https.
  • Reading a token. Pieces of a JWT are Base64URL. Decode one to see the JSON inside, or use the JWT decoder to do all three at once.
  • Checking an API value. Config files and responses often hold Base64 blobs. Decode to see what they are.
  • Building a query string. Encode a value before you put it after a ?, so a stray ampersand doesn't split it in two.

Why decoding fails

  1. Invalid characters. Base64 uses letters, digits, plus, slash and equals signs only. A space, quote or line break inside breaks it, though a few tools allow line breaks.
  2. URL-safe variant. A string with dashes and underscores instead of plus and slash is Base64URL. Switch the tool to the URL-safe option.
  3. Missing padding. The length should be a multiple of four, with equals signs on the end. Some systems drop them. Add = until the length fits.
  4. Decoded text looks like garbage. The data may not be text at all, for example an image or compressed data, or it was encoded with a different character set.
  5. Double encoding. If decoding gives another Base64 string, run it through again. The same goes for URL encoding that shows %2520, which is an already-encoded percent sign.

Accents, emoji and other languages

Text is turned into UTF-8 bytes first. That's why café encodes to Y2Fmw6k=: the accented letter takes two bytes. Tools that skip this step corrupt non-English text. You can chain steps: use the result as new input to encode twice, or to encode first and then URL-encode.

If you need to embed a picture, the image to Base64 tool turns a file into a data URI. For the reasons Base64 is a third bigger, why it isn't encryption, and when Base32 is the better choice, read the Base64 guide. The text to binary converter shows the bytes underneath.

Written by Akinrinmade Michael · Updated October 24, 2026

How to use

  1. 1Choose Base64 or URL, then Encode or Decode.
  2. 2Type or paste your text into the top box.
  3. 3The result appears below immediately.
  4. 4Click Copy result, or use the result as new input to chain steps.

Frequently asked questions

What is Base64?

Base64 turns any text or data into a string of 64 safe characters (letters, digits, + and /). It is often used to embed data in emails, URLs and JSON.

Does it handle emoji and accented letters?

Yes. Text is converted as UTF-8 first, so characters such as é, 世界 and emoji encode and decode correctly.

What is URL-safe Base64?

It swaps + and / for - and _ and drops the = padding, so the result can sit inside a URL or file name without further escaping.

Is Base64 encryption?

No. Anyone can decode it, so never use it to protect secrets. It only changes how data is written.

Read the guides

Learn how this works and how to get the most from it.

Developer

Base64 Explained: What It Is and When to Use It

How Base64 and Base32 encoding work, a worked example by hand, why Base64 makes data 33% larger, and when to use each. Neither one is encryption.

3 min read

Security

How to Decode a JWT and Read Its Claims

A JSON Web Token has three parts. Learn what each part holds, what exp and iat mean, and why decoding a token isn't the same as trusting it.

3 min read

Developer

SSH Keys and Key Pairs Explained: Which Type to Pick

What a public and private key pair is, how SSH keys let you sign in without a password, and how to choose between Ed25519, RSA and ECDSA.

4 min read

Base32 Encoder / Decoder

Encode and decode Base32, including hex and Crockford.

Image to Base64 Converter

Convert an image to a Base64 data URI, or turn Base64 back into an image.

URL Parser & Query Builder

Split a URL into its parts and edit its query parameters.

Hash Generator

Generate MD5, SHA-1, SHA-256 and SHA-512 hashes and HMACs.