Base64 在线解码和编码

在左侧输入或粘贴文本进行编码,或在右侧粘贴 Base64 进行解码。转换在浏览器中即时完成,无需上传任何内容。

  • 本地运行,无需上传
  • 无需注册
  • UTF-8 及 35 多种字符集
  • 支持全部 8 种 Base64 标准

编码为 Base64

所有编码器

Base64 解码

所有解码器

开发者工具

All developer tools

为什么选择这款 Base64 转换器?

  • 隐私安全。文本和文件均通过 JavaScript 在本地处理,即使是大文件或机密文件也不会离开您的设备。
  • 兼容实际场景中的 Base64。自动接受 Data URI、换行、URL 安全字符和缺失的填充,出错时精确定位到具体字符。
  • 支持所有标准。标准 RFC 4648、Base64URL、MIME、PEM、IMAP、XML 以及 OpenPGP 封装格式。
  • 支持所有字符集。UTF-8、UTF-16、Windows-125x、ISO-8859-x、Shift_JIS、GBK、Big5、EUC-KR、KOI8 等。
  • 输出即可粘贴。直接获取 Data URI、CSS 规则、HTML 标签、JSON 或 XML 代码片段,而不只是一串字符串。

Base64 decode and encode for developers

Developers use Base64 every day: embedding images in CSS and HTML, shipping binary in JSON APIs, reading JWTs, attaching files in MIME e-mail, and storing keys in PEM certificates. This free online Base64 decoder and encoder is built for that workflow—fast, accurate across standards, and private by default.

  • Decode Base64 to text or file with automatic standard and charset detection, plus image/PDF/audio/video preview.
  • Encode text, files or URLs to Base64 with UTF-8 and 35+ character sets, MIME line wrapping and Base64URL.
  • Validate, repair and normalize messy Base64 from logs, e-mail and copy-paste with dedicated developer tools.
  • Language guides for JavaScript, Python, Java, Go, PHP, C#, Node.js and Bash so you can match what your code produces.

Developer & IT toolkit (daily corporate searches)

Engineers live in browser tabs: regex on logs, cron next-runs, config diffs, CIDR math, YAML↔JSON for Kubernetes. All of these run locally here—safe when policy forbids pasting secrets into random SaaS.

  • Regex tester — live highlight + presets (email, IP, UUID).
  • Cron explainer — plain English + next fire times.
  • Diff checker — compare configs / API responses privately.
  • CIDR subnet calculator — VPC and firewall planning.
  • YAML ↔ JSON — K8s, GitHub Actions, Ansible.

Regex tester · Cron explainer · Diff checker · Subnet calculator · YAML ↔ JSON · Dev/IT guide

Christmas 2026: Secret Santa & countdown (high season)

From November through Christmas Eve, millions search for Secret Santa generators and “days until Christmas.” Draw Amigo Secreto privately with Base64URL links—no email signup—and keep a live countdown on your device.

  • Secret Santa / Amigo Secreto — fair draw, couple exclusions, pass-the-phone or private WhatsApp links.
  • Christmas countdown — how many days until Dec 25 in your timezone.

Secret Santa generator · Christmas countdown · Christmas traffic guide

Save bandwidth: compress before Base64

Where mobile data is expensive—Brazil, LATAM and other prepaid markets—uploading a huge photo just to shrink it wastes the plan. Compress locally first, then encode or share once.

  • Compress images to WebP/JPEG in your browser, see % saved, then download or copy Base64—no upload.
  • Gzip text or JSON before Base64 for APIs; decompress payloads you receive.
  • Private by design — Canvas and CompressionStream run on your device.

Compress image · Gzip compress · Compress before Base64 · Save mobile data guide

Private media tools (not social downloaders)

We will not scrape Instagram, LinkedIn, Pinterest or Kuaishou. We do help you prepare files you already own: convert HEIC/WebP, merge PDFs, cut out backdrops, build favicons—entirely in the browser.

  • HEIC / WebP / SVG converter — iPhone photos and WebP downloads without uploading to Adobe/Canva-style sites.
  • Merge PDF — combine contracts or turn images into a PDF locally (no Smallpdf upload).
  • Remove background from product shots and logos (solid/near-solid backdrops).
  • Favicon generator — PNG sizes, HTML tags and webmanifest, plus Base64 copy.

Image converter · Merge PDF · Remove background · Favicon generator · HEIC & WebP guide

Built from real Reddit gaps (not Base64-only)

Users on Reddit keep asking for tools that never upload files: strip GPS EXIF, hash checksums, JSON formatters without ads, QR codes without tracking short links. We ship those here—private, free, and ranked for EU and US search.

  • Strip EXIF before posting photos.
  • Hash, JSON, UUID, timestamp, password, QR — everyday utilities that stay on-device.

Strip EXIF · Hash generator · JSON formatter · QR generator · Reddit gap write-up

Base64 reader: paste and see

Need a live Base64 viewer? Paste a string or data URI and read the result immediately—text, image, PDF or hex—or get Base64 output as you type plain text. No Decode click required.

Base64 reader · Why live readers win

Built for the AI era

ChatGPT and Claude often invent Base64 that looks right but is wrong. AI agents double-encode payloads and burn context on huge Base64 blobs. This site’s principle: never trust a model to be the encoder—verify with a real tool in your browser.

  • Verify Base64 from LLM output with round-trip checks before you ship a header or JWT.
  • Unwrap nested Base64 when an agent or gateway encoded twice.
  • URL encode/decode beside Base64URL for safe query strings.
  • Principles for agents and MCP: deterministic tools, privacy, right dialect, watch token cost.

Verify Base64 · Unwrap nested Base64 · AI agent guide · Why ChatGPT fails at Base64

Advanced options

  • Character set. Base64 encodes bytes. Choose UTF-8 (default) or a legacy charset before encoding, or auto-detect when decoding text.
  • Live mode. Enable “Convert as I type” to encode or decode instantly in the browser with no round-trip to a server.
  • URL-safe Base64 (Base64URL). Use the Base64URL encoder/decoder for JWTs, tokens and filenames without escaping "+" or "/".
  • MIME and PEM wrapping. Split lines at 76 or 64 characters when a mail client, certificate or OpenPGP tool expects wrapped output.
  • Per-line encoding. On the text encoder, encode each line separately when you have multiple independent values.

Safe, free and private

All conversions run over HTTPS. Text and local files are converted in your browser with JavaScript—they are not uploaded or stored. The site is free to use with no account and no software to install. Optional remote URL fetching and a few network tools use our API; those responses are not kept for inspection.

30 秒了解 Base64 原理

Base64 每次读取三个字节(24 位),将其拆分为四组 6 位,并把每组映射到 64 个字符之一。例如单词 Man(字节 77 97 110)会变成 TWFu。阅读分步算法详解,或从什么是 Base64?开始了解。

Common uses include MIME e-mail attachments, data URIs in HTML and CSS, binary fields in JSON or XML, HTTP Basic authentication, and PEM-encoded certificates. When you need the reverse path, use Base64 decode online; to produce Base64 from scratch, use Base64 encode online.

常见问题

什么是 Base64?

Base64 是一种仅用 64 个可打印字符(A–Z、a–z、0–9、“+”和“/”)表示二进制数据(图片、文件、任意字节)的方法。它让二进制数据能够安全地通过 JSON、HTML、电子邮件和 URL 等只能处理文本的系统传输。

How do I decode Base64 online?

Paste your Base64 string into the right box (or open the Base64 Decode page) and click Decode. Live mode updates as you type. Data URIs, line breaks and URL-safe characters are accepted automatically.

How do I encode text or a file to Base64?

Type text on the left and click Encode, or open Base64 Encode and choose Text, Local file or Remote URL. You can pick UTF-8 or 35+ character sets and eight Base64 standards including MIME and Base64URL.

Base64 是加密吗?

不是。Base64 是编码而不是加密。任何人无需密钥即可解码,所以切勿用它来隐藏密码或机密信息。

我的文件会上传到你们的服务器吗?

不会。编码和解码完全在您的浏览器中运行。只有可选的“从 URL 加载”功能和少数网络工具会用到我们的服务器,且不会存储任何内容。

为什么 Base64 输出比输入大?

每 3 个字节变成 4 个字符,因此 Base64 比原始数据大约大 33%,另外最多还有两个“=”填充字符。

末尾的“=”是什么意思?

这是填充。当输入长度不是 3 的倍数时,会用一个或两个“=”字符补齐最后一组 4 个字符。

What is Base64URL?

Base64URL (RFC 4648 §5) replaces "+" with "-" and "/" with "_" and often omits "=" padding so the string is safe in URLs, filenames and JWTs without percent-encoding.

Which character set should I use?

Use UTF-8 unless the receiving system requires a legacy encoding. The same text produces different Base64 in UTF-8, Windows-1252 or Shift_JIS because Base64 encodes bytes, not letters.

评论 (0)

对“Base64 在线解码和编码”有疑问、想法或发现了 bug?欢迎留言评论、为工具评分或回复他人。

暂无评论,快来分享您的反馈吧!

发表评论

为此工具评分:
Esc
↑ ↓ 移动↵ 打开Esc 关闭