Developer Tools

Base64 Encoder & Decoder

Encode text to Base64 or decode it back, UTF-8 safe: standard and URL-safe alphabets, padding control, file-to-Base64, and data-URI decoding, all in your browser.

Your result will appear here.

Input: 0 characters / 0 bytes

File is read locally in your browser and never uploaded.

🔒 Privacy: conversion runs locally in your browser. Base64 is encoding, not encryption: anyone can decode it, so never use it to hide a password or API key.

More developer tools

How this calculator works

Base64 turns any bytes into plain ASCII text so binary data can travel through systems that only handle text: JSON payloads, email attachments, data URIs, JWT tokens and config files. This tool encodes text to Base64 and decodes Base64 back to text, entirely in your browser. Paste a string, pick Encode or Decode, and copy the result. A file mode encodes any local file to its Base64 string, and pasting a data URI decodes just the payload part after the comma.

The detail that breaks most quick tools is character encoding. Naive encoders built on the old btoa function corrupt anything outside Latin-1: emoji, accented letters and non-English scripts come back mangled. This tool converts text to real UTF-8 bytes first, so Hindi, Spanish accents and emoji round-trip exactly. Worked example: the word Authgear encodes to QXV0aGdlYXI=, and the Hindi word नमस्ते encodes to 4KSo4KSu4KS44KWN4KSk4KWH. Decoding accepts strings with or without the trailing = padding, and the URL-safe variant swaps + for - and / for _, which is the alphabet JWTs and OAuth tokens use.

One honest warning belongs on every Base64 page: Base64 is not encryption. Anyone can decode a Base64 string in a second, so never use it to hide a password, API key or secret. Its job is transport, not secrecy. For tokens and API payloads you are debugging, the in-browser design matters: nothing you paste is uploaded, so inspecting a suspicious Base64 payload from a log or email stays private to your machine.

Frequently asked questions

How do I encode text to Base64?
Paste or type your text, keep Encode selected, and copy the output. The tool encodes real UTF-8 bytes, so emoji, accents and non-English scripts survive the round trip.
How do I decode a Base64 string?
Switch to Decode and paste the string. Padding (=) is optional, and data URIs work too: paste the whole data:...;base64,... value and only the payload is decoded. If the result is not valid UTF-8 text (for example a decoded image), the tool shows a clear error instead of garbage.
What is the difference between Base64 and Base64URL?
Base64URL replaces + with - and / with _, and usually drops the = padding, so the string is safe inside URLs and filenames. Tick the URL-safe box when encoding for a JWT, OAuth token or URL parameter; decoding accepts either alphabet automatically.
Why did my decode fail?
Usually a stray character: a space inside the string, a missing character, or text that was never Base64 at all. The decoder also rejects strings whose bytes are not valid UTF-8 text, which happens when decoding a file payload (like an image) as text.
Can I encode a file to Base64?
Yes. Use the file picker at the bottom of the tool: the file is read locally in your browser and its Base64 string appears in the output. Nothing is uploaded to any server.
Is Base64 encryption?
No. Base64 is reversible encoding for transport, not secrecy: anyone can decode it instantly. Never use it to hide passwords, API keys or other secrets.
Disclaimer: Results are estimates for planning purposes only and are not financial advice. Actual loan terms, taxes and investment returns vary. Consult a qualified professional before making financial decisions.