Base64 & URL Encoder / Decoder

Encode text to Base64 or decode it back, switch to URL-safe Base64, and handle percent-encoding for query strings and URL components. Small files can be converted to data URIs too. Nothing is sent anywhere, so secrets stay on your machine.

Type or paste text to convert in real time
Standard Base64 with +, / and = padding.
Input Plain Text
0 chars
Encoded Output
0 chars

How to use the Base64 Encoder

Four steps, no account, nothing uploaded.

  1. Choose a mode

    Pick Base64, Base64URL or URL percent-encoding depending on where the output will be used.

  2. Enter your input

    Type or paste text into the input panel. To encode a file instead, use the file picker to generate a data URI.

  3. Encode or decode

    Press Encode or Decode. Results appear immediately, and invalid input is flagged with a clear explanation.

  4. Copy the output

    Use Copy to place the result on your clipboard, or Swap to move it into the input for chained conversions.

Why use this tool

Built so your files never have to trust a server.

Secrets stay local

Base64 is encoding, not encryption — anything you paste is trivially readable. That is exactly why decoding tokens should never happen on someone else's server. Here it does not.

Full Unicode support

Text is converted through UTF-8 before encoding, so emoji, accents and non-Latin scripts survive the round trip intact.

URL-safe variants

Switch to Base64URL for JWTs and query parameters, or use percent-encoding for encodeURIComponent-compatible output.

File to data URI

Convert a small image or font into a ready-to-paste data URI for inlining directly in CSS or HTML.

Frequently asked questions

Everything people ask about the Base64 Encoder.

Is Base64 encryption?

No. Base64 is a reversible encoding that represents binary data using 64 printable ASCII characters. Anyone can decode it instantly with no key. Never use it to protect passwords or secrets — use real encryption for that.

What is the difference between Base64 and Base64URL?

Standard Base64 uses "+" and "/", which have special meaning inside URLs, and pads with "=". Base64URL substitutes "-" and "_" and usually omits the padding, making the output safe to drop into a URL path or query string. JSON Web Tokens use the URL-safe variant.

When should I use URL encoding instead?

Percent-encoding is for making text safe inside a URL, converting characters such as a space into %20. Use it for query-string values and path segments. Base64 is for representing arbitrary binary data as text, which is a different problem.

Why did my emoji or accented characters break elsewhere?

The classic btoa function fails on characters above U+00FF. This tool encodes text as UTF-8 first, so emoji and non-Latin scripts round-trip correctly. If another tool mangled your text, it most likely skipped that UTF-8 step.

Can I decode a JWT here?

You can decode the header and payload segments, which are Base64URL-encoded JSON — paste a segment (the part between dots) and decode in Base64URL mode. The signature is binary and will not render as readable text. Doing this locally is far safer than pasting a live token into an online decoder.

How much larger does Base64 make my data?

About 33% larger, since every three bytes become four characters, plus padding. That overhead is why inlining large images as data URIs usually hurts page performance rather than helping it.

What file size can I convert to a data URI?

Files up to a few megabytes work fine. Larger ones produce enormous strings that will make the browser sluggish. As a practical rule, only inline assets under roughly 10 KB — beyond that a normal file request is faster.

More free utilities that run entirely in your browser.

Browse all tools

JSON Formatter

Beautify, minify and validate JSON with precise error locations.

Developer Tools

Word Counter

Count words and characters live, with readability scoring and keyword density.

Text Tools

Image Converter

Convert PNG, JPEG and WebP images and compress them with a quality slider.

Image Tools