Base64 Encode / Decode

Encode text or files to Base64 and decode Base64 back to readable text or a downloadable file. Full UTF-8 support (accents, emoji, any language) and a URL-safe option for tokens and web use.

Encoding and decoding happen in your browser. Your text and files are never uploaded.

Rate this tool

Be the first to rate this tool

How to use the Base64 Encode / Decode

  1. Choose Text mode to work with words, or File mode for images, PDFs and other files.
  2. To encode, type in the “Plain text” box – the Base64 appears instantly. To decode, paste Base64 into the right box and the text appears on the left.
  3. Turn on URL-safe mode for tokens, JWT parts and URL parameters.
  4. Copy the result, or in File mode download the decoded file.

What is Base64?

Base64 is a way of writing binary data using only 64 safe characters: A–Z, a–z, 0–9, plus + and /, with = as padding. Many systems were designed to carry text, not raw bytes – email, JSON, XML, URLs, HTML attributes and HTTP headers among them. Base64 lets you send images, files, keys and other binary content through those channels without it getting corrupted. Every 3 bytes of input become 4 characters of output, so Base64 data is about 33% larger than the original.

Base64 is encoding, not encryption

Anyone can decode Base64 instantly – this tool is proof. Never use it to hide passwords or secrets. It only changes the representation of data, not its secrecy. Use real encryption when you need privacy.

Common uses

  • Data URIs: embed small images or fonts directly in HTML or CSS, like data:image/png;base64,….
  • APIs and JSON: send file contents or binary values inside JSON fields.
  • HTTP Basic authentication: the Authorization header carries username:password in Base64.
  • JSON Web Tokens (JWT): the header and payload are Base64URL-encoded. Paste one part with URL-safe mode on to read it.
  • Email attachments: MIME encodes attachments in Base64, wrapped at 76 characters per line.

UTF-8 and URL-safe Base64

The browser’s basic Base64 functions only handle Latin-1 characters and fail on emoji or non-English text. This tool first converts text to UTF-8 bytes, so “café ☕” or “こんにちは” encode and decode correctly. URL-safe Base64 (also called Base64URL, defined in RFC 4648) replaces + with - and / with _ and usually drops the = padding, so the result can sit in a URL or file name without extra escaping. When decoding, both variants are detected automatically, and whitespace and line breaks are ignored.

Examples

TextBase64
Hello, World!SGVsbG8sIFdvcmxkIQ==
café ☕Y2Fmw6kg4piV
user:passdXNlcjpwYXNz

Base64 Encode / Decode FAQ

How do I decode Base64 to text?

Paste the Base64 string into the Base64 box. The decoded text appears instantly in the Plain text box. Standard and URL-safe Base64 are both accepted.

Why does my decoded text look garbled?

The Base64 probably contains a binary file (such as an image or PDF) rather than text. Switch to File mode, paste it under “Base64 → File” and download the decoded file.

Is Base64 secure?

No. Base64 is reversible encoding, not encryption. Anyone can decode it, so do not use it to protect sensitive information.

How do I convert an image to Base64?

Open File mode, choose your image and copy the result. Keep “Include data URI prefix” checked to paste it straight into an HTML img src or CSS url().

Related tools

All Developer Tools
JSON Formatter & ValidatorBeautify, minify and validate JSON with clear error messages.Compare Two ListsFind differences, common items, and unique entries between two text lists.Cron Expression GeneratorBuild cron schedules with simple menus, or paste any cron expression to explain it in plain English and see the next 5 run times.Diff CheckerCompare two texts and see every added, removed and changed line, with word or character highlights, side by side or unified.HEX to RGB ConverterConvert HEX color codes to RGB, RGBA and HSL and back, with a live swatch, color picker, alpha control and copy-ready CSS.JSON to CSVConvert a JSON array to CSV with nested objects flattened into dot-named columns, comma, semicolon or tab delimiters and a live preview.JSON to ExcelConvert a JSON array to a real Excel .xlsx spreadsheet or CSV, with nested objects flattened into dot-named columns and a live preview.PX to REM ConverterConvert pixels (px) to rem and rem to px with custom root font size and CSS table.Regex TesterTest JavaScript regular expressions live: highlighted matches, capture and named groups, indices, flags and a replace preview.Unix Timestamp ConverterSee the current Unix epoch time live, convert timestamps in seconds, milliseconds or microseconds to dates, and dates back to timestamps.URL Decode & EncodeDecode or encode URLs and query strings (percent-encoding), with + as space option and a query parameter table.Stripe Fee CalculatorCalculate Stripe card fees and find the exact invoice amount to receive your target net.Dice RollerRoll 1 to 10 virtual dice (d4 to d100) with a modifier, fair random results and a history of your last rolls.