Free online Base64 encoder and decoder (text, JSON, data URLs)
This page gives you a fast, browser-based Base64 encoder and decoder. Use it to convert plain text, JSON, or small binary blobs into Base64, or to decode an existing Base64 string back into readable text. Everything happens locally in your browser — no uploads, no background requests, and no account needed.
The encoder is UTF-8 aware, so Emoji, non-Latin scripts, and accents survive a full encode/decode round-trip. You can switch to the URL-safe Base64 variant when you need values for query strings, cookies, filenames, or JWTs. You decide whether to keep or remove = padding, and whether to wrap lines at 64 or 76 characters to match common conventions (76 is the MIME standard used in many email systems). The decoder is forgiving: it trims whitespace, accepts URL-safe input, restores missing padding, and can extract the payload from a full data URL.
How to use the Base64 Encoder & Decoder
- Enter your inputTo encode text to Base64, type or paste plain text, JSON, or other UTF-8 content in the left panel. To decode Base64 to text, paste a Base64 string or full data URL in the right panel.
- Choose options (optional)Toggle URL-safe, Remove padding, and pick a line width (None, 64, or 76 for MIME). The tool is compatible with common APIs, JWT libraries, and email encoders.
- Copy / Upload / DownloadUse Copy on any panel to grab the current text, Upload a
.txtfile to either side to encode or decode it, or Download the current output as.txtto save it locally. - Fix invalid inputsBase64 works in blocks of four characters. If decoding fails, check for stray characters, remove spaces or line breaks that don’t belong, or paste the full data URL so the tool can extract the Base64 segment for you.
Guide: where this Base64 tool is useful
Where this helps: tokens in headers or cookies, small payloads in query strings, email bodies that need MIME-safe wrapping, JWT debugging, and inspecting opaque Base64 blobs from logs or webhooks. Paste, decode, and see what’s really inside — all in one tab, without uploading data to another site.
What Base64 is — and isn’t: it’s an encoding scheme, not a cipher. Base64’s job is to make bytes safe for text-only pipelines, not to hide secrets. If you need confidentiality, combine this tool with proper encryption. For percent-encoding of URLs, head to URL Encoder/Decoder. Working with JSON payloads that you later Base64-encode? Use JSON Formatter to pretty-print and validate them before encoding. Sharing those links or tokens visually? The QR Code Generator turns any URL or identifier into a scannable QR code in seconds.
Key features of this Base64 encoder & decoder
- Free online Base64 encoder and decoder that runs 100% in your browser — no uploads, no tracking, no sign-up.
- UTF-8 safe encoding and decoding so emoji, accented characters, and non-ASCII scripts round-trip correctly.
- URL-safe Base64 option that replaces + and / with - and _ for query strings, cookies, JWTs, and filenames.
- Optional removal of trailing = padding when your API, CDN, or token consumer allows unpadded Base64.
- Configurable line breaks at 64 or 76 characters (76 is the MIME standard used in many email systems).
- Decoder accepts full data URLs (for example, images), trims whitespace, restores missing padding, and accepts URL-safe input.
- Per-panel Upload and Download, one-click Copy, Swap panels, and optional line wrapping for easier inspection.
- Works well for JSON payloads, API tokens, small file snippets, and debugging Base64 blobs from logs and webhooks.
Tips for working with Base64 safely
- Use the URL-safe Base64 option with no padding for query strings, cookies, JWT tokens, and filenames when your consumer supports it.
- If you are not sure what your API expects, keep padding enabled — many Base64 decoders require a length that is a multiple of 4.
- Choose 76-character lines for MIME email bodies; 64-character lines are common in PEM-style certificate and key blocks.
- If the decoder reports an error, check for stray spaces or non-Base64 characters and make sure the length ends up at a multiple of 4. Padding fixes lengths with remainder 2 or 3.
- Remember that Base64 is encoding, not encryption. For secrets, combine this tool with a proper encryption tool or library.
- When debugging a data URL, paste the entire string (including data: and base64,) so the tool can automatically pull out the Base64 section.
Frequently asked questions about Base64
Is Base64 encryption?
Is this Base64 encoder secure and private?
What is URL-safe Base64?
+// for -/_ so the string works cleanly in URLs, filenames, and cookies. Many systems also drop the trailing = padding in this mode, which this tool can generate for you.Why do I see '=' at the end of a Base64 string?
= characters are padding. Base64 works in blocks of 4 characters; padding is added so the total length is a multiple of 4. Some decoders need it, others don’t. If a consumer complains, try toggling the padding setting here.Can I decode a full data URL or Base64 image?
data:image/png;base64,AAAA…) into the right panel. The tool automatically detects the data URL, extracts the Base64 portion, and decodes it back to text or bytes.