Base64 workbench
Base64 Decoder
Decode Base64 to text or any file online: auto-detects charset and payload type (images, audio, video, PDFs, archives, unknown binaries), previews media and saves files with the right name. 100% private, in your browser.
Decoded text
Preview
Alternative readings
These bytes also decode cleanly in these character sets — ranked by confidence.
Decoding…
0%
Your decoded text appears here — instantly, as you paste
Waiting for input…
Recent inputs— stored only in this browser
// Browser — ASCII fast path
const ascii = atob('SGVsbG8sIHdvcmxkIQ==');
// Browser — correct UTF-8 decoding (emoji, accents, CJK)
const bytes = Uint8Array.from(atob('SGVsbG8sIPCfjI0h'), (c) => c.charCodeAt(0));
const text = new TextDecoder('utf-8').decode(bytes);
// Node.js / Bun / Deno
const decoded = Buffer.from('SGVsbG8sIHdvcmxkIQ==', 'base64').toString('utf8');import base64
# Bytes → str
text = base64.b64decode('SGVsbG8sIHdvcmxkIQ==').decode('utf-8')
# URL-safe alphabet ("-" and "_" instead of "+" and "/")
text = base64.urlsafe_b64decode('SGVsbG8sIHdvcmxkIQ==').decode('utf-8')
# Straight to a file
with open('image.png', 'wb') as f:
f.write(base64.b64decode('iVBORw0KGgo='))<?php
// Text
$text = base64_decode('SGVsbG8sIHdvcmxkIQ==');
// Strict mode — returns false instead of garbage on invalid input
$bytes = base64_decode('SGVsbG8sIHdvcmxkIQ==', true);
// Write decoded bytes to a file
file_put_contents('image.png', base64_decode($payload));package main
import (
"encoding/base64"
"fmt"
)
func main() {
bytes, err := base64.StdEncoding.DecodeString("SGVsbG8sIHdvcmxkIQ==")
if err != nil {
panic(err)
}
fmt.Println(string(bytes)) // Hello, world!
// URL-safe alphabet (JWT payloads)
urlBytes, _ := base64.URLEncoding.DecodeString("SGVsbG8sIHdvcmxkIQ==")
fmt.Println(string(urlBytes))
}import java.nio.charset.StandardCharsets;
import java.util.Base64;
public class Decode {
public static void main(String[] args) {
byte[] bytes = Base64.getDecoder().decode("SGVsbG8sIHdvcmxkIQ==");
String text = new String(bytes, StandardCharsets.UTF_8);
// URL-safe alphabet, as used in JWTs
String jwt = new String(
Base64.getUrlDecoder().decode("SGVsbG8sIHdvcmxkIQ=="),
StandardCharsets.UTF_8);
}
}using System;
using System.IO;
using System.Text;
byte[] bytes = Convert.FromBase64String("SGVsbG8sIHdvcmxkIQ==");
string text = Encoding.UTF8.GetString(bytes);
// Write the decoded bytes back to a file
File.WriteAllBytes("image.png", bytes);# Linux / macOS
echo 'SGVsbG8sIHdvcmxkIQ==' | base64 --decode
# macOS before Ventura uses -D
echo 'SGVsbG8sIHdvcmxkIQ==' | base64 -D
# Decode a whole payload file to disk
base64 -d payload.b64 > image.png
# PowerShell
[System.Text.Encoding]::UTF8.GetString(
[System.Convert]::FromBase64String('SGVsbG8sIHdvcmxkIQ=='))How to use
Base64 Decoder, step by step
- 01
Paste Base64 — the decoded text appears live, with size, type, charset and timing stats below. Whitespace, line breaks and data URI prefixes are handled automatically.
- 02
Leave the charset on Auto-detect (it explains what it found) or pick from 91 sets; switch to the Hex view to inspect raw bytes, or hit “Download as file” to save them with the right extension.
- 03
Decoded media previews inline — images, audio, video, PDFs. Any other payload (archives, Office documents, unknown binaries) downloads with a correctly named file. Have a file full of Base64? Click “Open Base64 file” — or drop the file straight onto the input — and it decodes in a Web Worker.
FAQ
Frequently asked questions
Yes. The decoder runs 100% in your browser — your input is never uploaded, logged or sent anywhere. You can verify it yourself: disconnect from the internet and the decoder keeps working.
The replacement character means the bytes aren’t valid in the selected character set. Leave the charset on Auto-detect — it inspects the decoded bytes with letter-frequency analysis across all 91 supported character sets and picks the right one, telling you why. If you already know the charset, select it manually.
Yes, automatically. The decoder recognizes the URL-safe alphabet (“-” and “_” instead of “+” and “/”), tells you when it detected it, and missing padding (“=” characters) is handled too.
Yes — a leading data:image/png;base64,… prefix (or any data:…;base64, prefix) is stripped automatically and reported in the status bar.
Base64 can represent any bytes — images, PDFs, archives — not just text. The Hex view shows the raw decoded bytes, which is handy for debugging encodings or inspecting binary headers.
Normally line breaks are treated as whitespace inside one Base64 value. With this option every line is decoded as an independent entry — line 1 decodes to its own value, line 2 to its own, and so on. Use it for lists of encoded values, CSV exports or log files.
Off by default, the decoder gives precise errors: which character, at which position, is invalid. Lenient mode silently drops anything outside the Base64 alphabet instead — useful for cleaning up copy-pasted Base64 with stray punctuation or markup.
Yes. Paste the Base64 of an image (a data URI works too — the prefix is ignored) and the decoder shows a live preview, plus a “Download as file” button that saves it with the right extension. Audio, video and PDF previews work the same way.
Any type — that is the point of this page. Images, audio, video and PDFs preview inline; ZIP archives, DOCX/XLSX/PPTX documents, executables and unknown, extension-less binaries all download with their MIME sniffed from the magic bytes (never guessed from the file name) and the correct extension added. Even when the type is unknown, you get the exact bytes as a .bin file with the size shown.
No server-side limit exists because nothing is uploaded — the practical limit is your device memory. Large inputs decode in a Web Worker, so the page stays responsive.
Related tools