Base64 Encode & Decode Online
Convert text to Base64 and back instantly — URL-safe mode and file-to-Base64 included. Private by design: everything runs in your browser.
18 chars in → 24 chars out
Tip: Base64 is encoding, not encryption — anyone can decode it. Never use it to “hide” passwords or secrets. URL-safe mode replaces + / with - _ and strips padding, which is handy for tokens and query strings.
Related guide
Read guide: Base64 encode & decode (URL-safe mode, files, UTF-8) →
Base64 encoder & decoder (free, no signup)
Base64 is a way to represent binary data as plain ASCII text. Developers use it every day: embedding images in HTML with data URIs, passing tokens and API keys in headers, stuffing small files into JSON payloads, and debugging encoded strings in logs. This free Base64 converter encodes text to Base64 and decodes Base64 back to text instantly, right in your browser — nothing is uploaded, so even sensitive tokens stay on your machine.
To encode, paste your text and switch to “Encode → Base64”. To decode, paste the Base64 string and switch to “Decode Base64 →”. Results update live as you type. If you work with URLs or JWTs, turn on URL-safe output to get - and _ instead of + and /. One thing to remember: Base64 makes data about 33% larger, so it is best for small payloads, not multi-megabyte files.
Common use cases
- Encode API keys or auth tokens for headers and configs
- Decode a JWT payload or a mysterious string from a log file
- Convert an image to a data URI for embedding in HTML/CSS
- Generate URL-safe tokens without manual escaping
If you also format API payloads, pair this with ToolsOfWeb’s JSON Formatter to pretty-print responses before encoding them. For comparing two encoded strings, the Text Diff Checker highlights exactly what changed.
FAQs
Is Base64 encoding the same as encryption?+
No. Base64 is encoding, not encryption — anyone can decode a Base64 string. It only makes binary data safe to transport as text. Never use it to “hide” passwords or secrets.
Is my text or file uploaded to a server?+
No. Encoding and decoding run entirely in your browser using built-in JavaScript APIs. Your data never leaves your device.
What is URL-safe Base64?+
Standard Base64 uses + and /, which need escaping in URLs. URL-safe mode replaces them with - and _ and strips padding (=), so the output works directly in query strings, filenames, and tokens like JWTs.
Why does decoding fail with an error?+
Usually a typo, a missing character, or pasted text that is not Base64 at all (for example, a hex string). The tool also accepts data URIs — it strips the “data:…;base64,” prefix automatically.
Can I convert an image to Base64?+
Yes. Use the “File → Base64” tab and drop in an image (or any file up to 25 MB). You get a full data URI like data:image/png;base64,… ready to embed in HTML, CSS, or JSON.
More free tools
Want guides and tips? Visit the ToolsOfWeb blog or go back to the homepage.
Related guide
Read guide: Base64 encode & decode (URL-safe mode, files, UTF-8) →
