LocalExcelTool
はじめる

Base64 デコード

Base64文字列を元のテキストに戻す。ローカル処理で安全。

Base64 デコードとは

Base64デコードとは、Base64で符号化された文字列を元のテキストやバイナリデータに戻す処理です。

🔒 処理はすべてブラウザ内で完結し、データは送信されません。

このツールの前提

処理場所
このページのブラウザ内(JavaScript / Canvas)
アップロード
なし — ファイルは端末の外に出ません
オフライン
ページを開いた後は通信不要

Decoding is a byte operation, not a text operation

The decoder walks the string four characters at a time, rebuilds three bytes from each group, then attempts to interpret the resulting bytes as UTF-8. If the bytes were never UTF-8 — a PNG, a ZIP, a PDF — the interpretation produces replacement characters or nonsense, and that is not a bug: the payload simply is not text.

This is the single most common confusion with Base64. A JPEG encoded to Base64 and then decoded back to a text box looks like garbage because an image is not text. The round trip only preserves information when the bytes are treated as bytes the whole way through, which is why file-oriented decoding should download a file instead of printing to a textarea.

Three ways a valid string fails to decode

First, the plus sign in transit. A query string uses application/x-www-form-urlencoded rules, where + means space. Any Base64 passed as a raw query parameter will therefore decode with spaces where plus signs used to be — one flipped bit per occurrence, no error raised. Pass it percent-encoded, or use the URL-safe alphabet.

Second, invisible corruption. Missing padding, a truncated tail, or a smart quote pasted along with the string all break the four-character alignment. A tolerant decoder may silently drop the tail and hand you a file that is three bytes short, which then fails its own checksum. Third, double encoding: if the decoded result still contains %xx sequences, the original was encoded twice and you need one more pass.

Sanity checks before trusting the result

On any binary output, verify the first bytes rather than the extension: files start with recognisable magics (PNG 89 50 4E 47, JPEG FF D8 FF, PDF 25 50 44 46, ZIP 50 4B 03 04). A file that decodes and then will not open almost always has the wrong magic, which tells you the source string was truncated or was never that format.

For text payloads, if the decoded result contains the replacement character U+FFFD, the bytes were not valid UTF-8 — the content may be Latin-1, Shift-JIS or GBK. Re-decode with the right charset instead of editing the output by hand.

使い方

  1. 1.Base64文字列を入力
  2. 2.「復号する」をクリック
  3. 3.結果を確認

他の方法との比較

同じ変換をする方法は 3 つあります。ブラウザ内(このページ)、サーバー側の変換サービス、デスクトップアプリ。差がつくのは速度ではなく、ファイルがどこへ行くかと、無料でどこまでできるかです。

観点このツールサーバー側の変換サービス
ファイルの処理場所このページのブラウザ内ベンダーのサーバー(アップロード後)
アカウント不要多くの場合必要(無料枠の制限解除に登録を求める)
無料で扱えるサイズサイズ制限なし(回数制限もなし)数ファイル/時間、または 5〜10MB 程度で課金 wall
料金無料。Pro は月 $9(大きいファイルと AI 機能のみ)サブスクが一般的。おおむね月 $7〜15(2026 年 11 月時点)
オフライン一度開けば通信不要不可
20MB を処理し始めるまで待ち時間なし(アップロードが無い)アップロードが支配的(10Mbps 上りで約 16 秒)
保証できないこと出力は決定的です。他の実装と突き合わせて検証できます同じ(変換の原理は変わらない)

サーバー側のサービスが優れている点は明確にあります。巨大なファイル、チームでの共有、変換履歴の管理、スクリプトからの自動化。逆に「1 回だけ、手元のファイルを別形式にしたい」という今回の用途では、アップロードの待ち時間と登録の手間だけが増えます。

よくある質問

Base64デコードとは?

Base64文字列を元のデータに戻す操作です。

不正な文字列はどうなりますか?

復号できない文字列の場合、エラーを表示します。

安全ですか?

ブラウザ内で完結するため、データは外部に送信されません。

この変換で失われるもの

エンコードとハッシュは Web Crypto API または純 JavaScript 実装で行います。出力は決定的で、同じ入力からは常に同じ結果になります。他のツールと突き合わせて検証できます。

その他のエンコード / デコード