Base64 & URL Encoder/Decoder
Encode or decode Base64, Base64url, and percent-encoded URLs with full UTF-8 support, precise error positions, and file-to-data-URI conversion — all in your browser.
Runs in your browser; nothing is uploaded.
Runs in your browser; nothing is uploaded.
How to use it
How to use this encoder
Pick a tab for the encoding you need:
Base64 — the standard alphabet (
A–Z a–z 0–9 + /) with=padding. This is what you'll see in email attachments (MIME), most API docs, and Basic-auth headers.Base64url — the same idea but with
-and_instead of+and/, and no padding, so the result is safe to use directly inside a URL path or query string (and is what JWT segments use).URL (component) — percent-encoding for a single value going into a query parameter or path segment (
encodeURIComponentsemantics): spaces,&,=,/and non-ASCII characters are all escaped.URL (full URI) — percent-encoding for an entire URL (
encodeURIsemantics): reserved characters like: / ? & =are left alone so the URL's structure survives, while spaces and non-ASCII text are still escaped.
Type in either box — the other updates automatically. Decoding accepts both the standard and URL-safe alphabets, with or without padding, and reports exactly which character broke the input and at what position if it can't be decoded. Text is handled as UTF-8 throughout, so non-Latin scripts and emoji round-trip correctly. You can also convert a file (up to 5 MB) directly into a data: URI.
Frequently asked questions
What's actually different between Base64 and Base64url?
They use the same encoding scheme with two characters swapped: '+' and '/' in standard Base64 become '-' and '_' in Base64url, and Base64url normally drops the trailing '=' padding. That makes Base64url safe to embed directly in a URL or filename, where '+' and '/' would need escaping.
When should I use URL component vs full URI encoding?
Use component encoding for a single value you're inserting into a query string or path segment — it escapes everything, including '&' and '=', which would otherwise be misread as part of the URL's structure. Use full-URI encoding only when you already have a complete URL and just need to escape spaces and non-ASCII characters in it.
Why did decoding fail with an error at a specific position?
Base64 only uses a 64-character alphabet (plus '=' padding); a decode error names the exact character and 0-based position that isn't part of that alphabet, so instead of a generic "invalid input" message you can find precisely where the copy-paste went wrong.
Is Base64 encryption or a security measure?
No. Base64 is purely a reversible text representation of binary data — anyone can decode it instantly, with or without this tool. It doesn't hide, protect, or authenticate anything; it's used for compatibility with text-only transports (email headers, URLs, JSON), not for confidentiality.
Does converting a file to a data URI upload it anywhere?
No. The file is read directly by your browser using the standard FileReader API and turned into a base64 data: URI locally. It's never sent to a server — that's also why there's a 5 MB limit, to keep the conversion fast in the tab.