Base64 Encoder & Decoder
Encode text or files to Base64 or data: URIs, and decode Base64 back to text, images or downloadable files, with URL-safe and MIME options.
Runs in your browser. Nothing you add is uploaded.
What the Base64 Encoder & Decoder does
Base64 encodes arbitrary bytes using 64 printable ASCII characters, which lets binary data survive channels that only accept text — email bodies, JSON fields, data URIs, HTTP headers. It is an encoding, not encryption: anyone can decode it instantly, and it offers no confidentiality whatsoever. This converter encodes text or any file, as plain Base64 or a ready-to-use data: URI, and decodes Base64 back to text, an image preview or a file you can download. It all runs in your browser, so credentials and files you decode for debugging never touch a server.
How to encode and decode Base64
- Choose Encode to Base64 or Decode Base64.
- To encode, type text or switch to File and drop in an image, font or PDF. For files, keep “As a data: URI” on to paste it straight into src= or url().
- Turn on URL-safe for values that go in URLs or file names, or line breaks for email (MIME).
- To decode, paste Base64 or a data: URI. Text is shown directly; images get a preview, and any file can be downloaded.
- If decoding fails, the message points to the character or length problem, such as a missing character at the end of a copied value.
The Base64 Encoder & Decoder runs entirely in your browser — nothing you enter is uploaded, stored, or logged.
When to use it
Inspecting Basic Auth headers
An 'Authorization: Basic' header is just base64 of 'username:password'. Decoding it while debugging shows immediately whether the client is sending the credentials you expect.
Building data URIs
Small images and fonts can be embedded directly in CSS or HTML as base64 data URIs, removing a network round trip at the cost of about 33% more bytes.
Moving binary through JSON
JSON has no binary type, so file contents are conventionally base64-encoded into a string field before transport and decoded on receipt.
Good to know
- Base64 inflates data by roughly 33%. Three bytes of input become four characters of output.
- A string whose length is not a multiple of four is either truncated or missing its '=' padding.
- URL-safe Base64 (RFC 4648 §5) swaps '+' for '-' and '/' for '_' so the result survives being placed in a URL. JWTs use this variant.
- Never treat Base64 as a security measure — it is trivially reversible by design.
Frequently asked questions
What is Base64 used for?
Is Base64 encryption?
Why does my Base64 string end in one or two equals signs?
Why does decoding produce garbled characters?
Can I encode files as well as text?
Does Base64 handle emoji and non-English text?
Related tools
HTTP Header Analyzer
Paste HTTP headers to see what each means and what to fix.
Regex Builder
Build a regular expression from blocks, with live matches.
SQL Formatter
Format, beautify, and minify SQL queries for Postgres, MySQL, and SQLite.
JSON to YAML Converter
Convert bidirectional JSON to YAML and YAML to JSON with presets.