Base64 Encode a URL

Base64 encode a URL to pass it safely as a parameter, hide it from casual reading or store it in a single token. Use Base64URL for safer links.

Part of the free Base64 Encoder. Runs in your browser — nothing is uploaded.

Base64 Encode a URL

Encoding a full URL with Base64 lets you carry it inside another URL without worrying about ?, & and # characters. For use in links, prefer the URL-safe variant so no further escaping is needed.

Worked example: A URL with query string

URL

https://example.com/path?x=1&y=2#top

Encodings

standard: aHR0cHM6Ly9leGFtcGxlLmNvbS9wYXRoP3g9MSZ5PTIjdG9w
url-safe: aHR0cHM6Ly9leGFtcGxlLmNvbS9wYXRoP3g9MSZ5PTIjdG9w

Practical tip

If you only need to put a URL in a query parameter, percent-encoding (encodeURIComponent) is simpler and keeps links readable.

How to use this Base64 Encoder

  1. 1Use the live tool above — it runs entirely in your browser and never uploads your data.
  2. 2Paste the sample from the worked example, or use your own input.
  3. 3Copy the result, then adapt the same steps in your editor, script, or pipeline.

Base64 Encode a URL FAQs

Is Base64 or percent-encoding better for URLs inside URLs?

Percent-encoding is standard and readable. Use Base64URL only when you need an opaque token or to avoid double-encoding issues.

Does Base64 protect a URL from being read?

No. It only obscures it. Anyone can decode Base64 in a second.

More Base64 Encoder pages

Open the full Base64 Encoder tool →