Base64 Encoder and Decoder Online — Encode Text, Base64URL, Files

Convert Base64 text

Base64 Encoder / Decoder

Encode text to Base64 or decode Base64 back to readable text in real time, with a Base64URL toggle that swaps the standard + and / characters for the URL-safe - and _ so JWTs, OAuth tokens, and webhook signatures work without further escaping. Live mode encodes as you type, while File mode turns any uploaded file into a Base64 string or rebuilds a binary file from a Base64 payload — ideal for embedding favicons, web fonts, and small images as data URIs that cut HTTP requests on your site. Use it to build Basic-Auth headers and API bearer tokens, package OAuth or webhook payloads, or inline tiny images and SVGs directly into HTML and CSS for faster page loads. The tool also decodes data URIs and Base64-encoded JWT segments so you can inspect headers and payloads during debugging. Everything runs 100% locally in your browser — your tokens, keys, and file contents are never uploaded to a server.

Embed assets and debug API payloads with Base64

Inline small icons, SVGs, and fonts as Base64 data URIs to cut HTTP requests and speed up Core Web Vitals, or decode incoming Base64 from API responses, OAuth tokens, and Basic Auth headers during debugging. A Base64URL toggle swaps the standard + and / for URL-safe - and _ and strips the padding, so the encoded output is safe to drop into a JWT, a query parameter, or a filename. Live mode re-encodes on every keystroke so you can watch the output update as you type.

File-to-Base64 and back, without uploading anything

Switch to file mode to convert any local file to a Base64 string, or paste a Base64 string and download the decoded binary back to disk — useful for inspecting attachments, regenerating PDFs from API responses, and pulling images out of JSON payloads. The entire encode/decode loop runs in your browser, so private documents, signed contracts, and credentials never traverse a third-party server. There is no file-size warning for typical payloads.

Frequently Asked Questions (FAQ)

Base64 turns binary data and special characters into a plain-text alphabet that survives email attachments, XML payloads, and URL parameters without corruption. It is used for data URIs (inlining favicons and small images to cut HTTP requests), Basic-Auth headers, OAuth tokens, JWT segments, and embedding JSON or HTML inside a JSON string without nested quote conflicts.

Base64URL is the URL-safe alphabet: it replaces + with - and / with _, and strips the = padding. This makes the output safe to drop directly into URLs, JWT tokens, and database keys without extra percent-encoding. Toggle the Base64URL switch to switch between the standard and URL-safe alphabets for both encode and decode.

Yes. File mode converts any uploaded file (image, PDF, document) into a Base64 string you can copy, and also decodes a Base64 string back into a downloadable binary file. Everything happens locally in your browser — the file is never uploaded to a server.

Yes. Live mode re-encodes or re-decodes on every keystroke, so the output updates as you type. Useful when you are iterating on API payloads, data URIs, or webhook bodies and want instant feedback.

The decoder validates the input and shows a clear error if the string is not valid Base64. Partial or corrupted input is reported so you can fix it instead of silently producing garbage bytes.

No. Every encode and decode operation runs locally in your browser using native JavaScript APIs. The tool is safe to use on API responses, auth tokens, and config files that contain credentials — nothing ever leaves your device.

Text mode has no length cap — paste a string of any size and it encodes or decodes on the spot. File mode accepts uploads up to 10 MB, which comfortably covers multi-megabyte images and PDFs; anything larger shows a clear error instead of freezing the tab. Keep in mind that Base64 output is roughly a third larger than the raw input, so a 10 MB file produces about 13 MB of encoded text.

Yes. The last 10 text-mode conversions are kept in a Recent operations list stored in your browser's localStorage. Each entry shows a preview of the input and output, and one click restores the input together with the mode and Base64URL settings it was made with. You can remove individual entries or clear the whole list — the history never leaves your device.