Base64 and URL Encoding Online: Differences and Common Uses
Summary:Encode and decode UTF-8 text with Base64 or URL percent-encoding in your browser. Learn which to use and how to troubleshoot malformed URL escapes.

Base64 and URL encoding are common in web development, but they solve different problems. Xian's Tools provides:

Both support Chinese and other UTF-8 text, process input locally in your browser, and let you copy the result.

Base64 encoding

What it does

Common uses

  • HTTP Basic authentication: `Authorization: Basic base64(username:password)`.
  • Representing binary data in JSON or XML.
  • Encoding email attachments.
  • Inspecting JWT headers and payloads, which use the related Base64URL variant. Standard Base64 and Base64URL use different characters and padding conventions; this tool is a text Base64 utility, not a dedicated JWT parser.

How to use the tool

Open Base64 Encoder and Decoder, enter text, and click Encode or Decode. Text is handled as UTF-8, so non-ASCII input can be decoded correctly in other systems using the same encoding.

Base64 does not protect secrets

Anyone can reverse Base64 encoding. It is not encryption and does not protect passwords or sensitive information. For reversible encryption testing, see AES Encryption and Decryption.

URL encoding

Encoding rules

The tool follows JavaScript's encodeURIComponent. Letters, digits, and - _ . ! ~ * ' ( ) remain unchanged; other characters are encoded. This is useful for individual query parameter values.

Encoding a whole URL also encodes separators such as ://, /, and ?, so the result cannot simply be visited as the original URL. Encode the value instead, for example:

https://example.com/search?q=hello%20world

A % that is not followed by two hexadecimal digits, as in 100%.

  • An incomplete UTF-8 sequence, such as %E4%B8.
  • Partially encoded or damaged input that leaves invalid escapes.

Double encoding can also produce an unexpected result: one decoding pass may return another encoded string. Check what the receiving system expects before decoding again.

Base64 and URL encoding compared

  • Purpose: Base64 represents bytes as text; URL encoding escapes text for use in a URL component.
  • Output characters: Base64 uses its fixed alphabet; URL encoding keeps permitted characters and escapes other bytes as %XX.
  • Length: Base64 expands bytes by roughly one-third; URL encoding expansion depends on the input and can be much larger for non-ASCII text.
  • Encryption: neither provides encryption.

When placing a standard Base64 result in a query parameter, URL-encode the value so characters such as +, /, and = are preserved correctly.

Related tools

Questions
Compress JPG and PNG Images Online Without Uploading Files
Reduce JPG and PNG file sizes in your browser. Learn how quality settings, output formats, and compression ratios affect your images.
Convert PNG to JPG and JPG to PNG Online
Convert PNG, JPG, and BMP images in your browser without uploading files. Learn how conversion affects transparency, file size, and image quality.
Crop Images Online: Aspect Ratios, Rotation, and WebP Export
Crop photos to 1:1, 16:9, and other aspect ratios. Rotate, flip, and lock your selection, then export PNG, JPG, or WebP directly in your browser.
Resize Images, View Image Information, and Create ICO Icons Online
Resize images, adjust output quality, inspect format and color space, and convert PNG or JPG to ICO icons with browser-based Image Tools.
Convert MOV to MP4, MKV to MP4, and MP4 to WebM Online
Convert videos between MP4, MKV, AVI, MOV, FLV, WebM, and M4V in your browser. Compare formats and learn what changes during conversion.
Trim and Crop Videos Online, Then Export MP4
Keep a selected video segment, remove black borders, or crop a recording to one area. Trim and crop locally in your browser and download an MP4.
Extract Audio from Video Online: Convert MP4 to MP3
Extract sound from MP4, MOV, or MKV videos and export MP3, WAV, FLAC, or M4A. Process recordings locally in your browser without uploading files.
Convert WAV, FLAC, and M4A to MP3 Online
Convert audio between MP3, WAV, FLAC, M4A, OGG, WMA, and AC3 in your browser. Compare formats and understand the tradeoffs in file size and quality.
Trim Audio Online: Cut MP3 Clips with a Waveform Preview
Select a time range on an audio waveform, listen to the preview, and export MP3. Make short clips or remove unwanted sections from recordings locally.
Generate and Read QR Codes Online from Text, Links, and Images
Create a downloadable QR code from text or a URL, or decode a QR image in your browser. Learn how to make codes easier to scan and inspect their links.
AES Encryption and Decryption Online: CBC, ECB, Keys, and IVs
Use AES-128, AES-192, or AES-256 with CBC or ECB in your browser. Check UTF-8 key lengths, IV requirements, and hex or Base64 ciphertext encoding.
Base64 and URL Encoding Online: Differences and Common Uses
Encode and decode UTF-8 text with Base64 or URL percent-encoding in your browser. Learn which to use and how to troubleshoot malformed URL escapes.
Random String Generator: Alphanumeric Test Data and Temporary IDs
Generate 1–10,000 alphanumeric characters with a letter first. Create test data and temporary identifiers, and learn why this tool is unsuitable for secrets.
Free Online Tools for Images, Video, Audio, and Encoding
Explore Xian's Tools for compression, conversion, trimming, QR codes, AES, and hashing. Learn how files are processed locally in your browser without uploads.
Compress Videos Online: MP4 Compression, Bitrate, and File Size
Compress MP4, MOV, and MKV videos locally in your browser. Learn how the quality slider changes bitrate and how to interpret the estimated output size.
Compress Audio Online: Reduce MP3 Bitrate and Recording File Size
Reduce audio file sizes locally in your browser. Learn how bitrate affects size and how to choose compression settings for speech, podcasts, and music.
Calculate MD5, SHA, and HMAC Online: Uses and Differences
Calculate MD5, SHA1, SHA256, SHA512, and HMAC for text in your browser. Understand digest lengths, API signatures, and why hashing is not encryption.