Base64 Encoder & Decoder - Text & File (URL-Safe Supported)

Encode any text or file to Base64, or decode Base64 back to text. URL-safe variant supported. Full UTF-8 support, runs entirely in your browser.

Input
Output

About Base64

Base64 represents binary data as ASCII text using 64 characters. URL-safe Base64 replaces "+/" with "-_" and strips trailing "=" padding so it can ride safely in URLs and filenames. Files become a data URL when encoded.

Frequently Asked Questions

Paste your text or drop any file into the input box, keep the mode on Encode and the Base64 representation appears in the output. For files you get a data URL that can be embedded directly in HTML, CSS or JSON — no upload server in between.

usage

URL-safe Base64 swaps "+" for "-" and "/" for "_" and strips the trailing "=" padding so the encoded value can travel inside URLs, filenames and JWT segments without further escaping. Toggle URL-safe whenever the output ends up in a query string, path segment or HTTP header.

technical

No. Base64 is an encoding, not encryption. Anyone can decode the string in one click, so never use it as a secrecy mechanism. Reach for AES, RSA or libsodium when you need real confidentiality, and use Base64 only to make binary data text-safe.

privacy

Base64 packs three bytes into four characters. When the input length is not a multiple of three, the encoder pads the final block with "=" so the output stays a multiple of four. Standard Base64 keeps the padding; URL-safe Base64 drops it because the length is implicit.

technical

Yes. The encoder reads the input as UTF-8 before encoding, so Arabic, Chinese, Cyrillic and emoji characters round-trip cleanly. The decoded result is rendered back as UTF-8 text, which is what every modern browser, terminal and API expects.

compatibility

Base64 inflates payloads by roughly 33% — three bytes of input become four bytes of output. That is fine for short tokens, small icons and JSON-embedded thumbnails, but for large assets prefer a direct binary upload or a CDN link to keep transfers fast.

technical

No. The encoder runs entirely inside your browser using the standard atob / btoa APIs plus a UTF-8 wrapper, so your text or file never reaches a server. That makes the tool safe for tokens, credentials and proprietary binaries you do not want to expose.

privacy

Use Cases

Embed Images in HTML & CSS as Data URLs

Inline small icons, logos and SVG sprites as Base64 data URLs to save HTTP requests, ship single-file HTML emails and keep prototypes self-contained without external asset hosting

web

API Authentication & Bearer Tokens

Build HTTP Basic auth headers, decode bearer tokens during API debugging and inspect base64-wrapped credentials shared in Postman, curl examples and OpenAPI docs

technical

Encoding Files for JSON & GraphQL Payloads

Wrap binary uploads (PDFs, images, audio clips) as Base64 strings so they ride safely inside JSON, GraphQL mutations and webhook bodies that only carry text

technical

Decoding Email MIME Attachments

Pull base64-encoded attachments out of raw .eml files, SMTP logs or IMAP responses to recover lost invoices, screenshots and documents from email exports

utility

URL-Safe Tokens for Web Apps

Generate URL-safe base64 strings for password-reset links, email-verification codes, share IDs and short URLs without breaking on "+" or "/" characters in browsers

web

Inspecting JWT Segments by Hand

Decode the header and payload segments of a JSON Web Token during local debugging when you do not have a full JWT decoder installed in your terminal or editor

technical