Home / Tools / Base64 and URL encoder

Base64 and URL encoder

Encode text to Base64 or decode it back, including the URL-safe variant, or percent-encode text for use in a URL. Text is treated as UTF-8.

  • Code tool
  • Runs in your browser
  • Tested 19 November 2026
  • Sources

What Base64 is for

Base64 turns any data into 64 safe characters: A to Z, a to z, 0 to 9, + and /. It's used wherever binary data has to travel through something built for text, such as email attachments, images embedded in web pages or JSON, and HTTP Basic authentication headers. AI APIs use it too: images are usually sent to a vision model as Base64 inside the JSON request.

Every 3 bytes become 4 characters, so Base64 is about a third bigger than the original. If the length isn't a multiple of 3, it's padded with =.

Base64 isn't encryption. Anyone can decode it. Never treat a Base64 string as a way to hide a password or API key.

Base64URL

Standard Base64's + and / have special meanings in URLs, so the URL-safe variant uses - and _ instead and usually drops the padding. JSON Web Tokens (JWTs) use it.

URL encoding

URL encoding, or percent-encoding, replaces characters that aren't allowed in part of a URL with % and their UTF-8 bytes in hex. A space becomes %20 and Ω becomes %CE%A9. This tool encodes the way JavaScript's encodeURIComponent does, which is right for a single query value.

In code

import base64, urllib.parse
base64.b64encode("Hello".encode()).decode()      # 'SGVsbG8='
base64.b64decode("SGVsbG8=").decode()            # 'Hello'
urllib.parse.quote("10 kΩ", safe="")             # '10%20k%CE%A9'

Sources

Where the formulas and figures on this page come from. We test every tool against worked examples from these before publishing.