PDFのミカタ

Base64をファイルに戻す方法

公開日:2026年10月19日|最終更新:2026年10月19日|運営者情報

この記事のポイント
  • 選ぶ
  • 貼る
  • 保存する

APIの結果や、メールの中に、長い英数字の文字列(Base64)が入っていて、中身が画像やPDFらしい。ファイルとBase64を相互変換する の「Base64 → ファイル」で、元のファイルに戻せます。

手順

  1. 「向きを選ぶ」で、「Base64 → ファイル」を選びます。
  2. 「Base64の文字」に、文字列を貼り付けます。
  3. 「保存するファイル名」を入れます。拡張子もつけます(例:image.png、document.pdf)。
  4. 「ファイルとして保存」を押して、保存します。
  5. 保存したファイルを、開いて確認します。
「Base64として読み取れませんでした。文字を確かめてください。」と出たら、文字が欠けているか、余分な文字が混ざっています。

拡張子の決め方

Base64の文字だけでは、元のファイルの種類が分かりません。次のような手がかりで、判断します。

データURLの場合

「data:image/png;base64,」のような、先頭の部分がついている文字列は、そのまま貼り付けられます。または、先頭部分を除いた、コンマ以降の文字だけを貼り付けます。

保存後の確認

向いている場面

例

APIの応答に、Base64の長い文字列があった。「Base64 → ファイル」に貼り付け、ファイル名を「result.pdf」にして保存。PDFとして開けた。

つまずきやすい点

よくある質問

長い文字列も貼り付けられますか?

はい。ただし、非常に長い場合は、時間がかかります。

まとめ

貼り付けて、拡張子つきのファイル名で保存。種類は、先頭の文字や説明から判断します。

ファイルとBase64を相互変換するを使う(無料)

あわせて使えるツール

この解説が役に立ったら、応援してもらえるとうれしいです。

応援する(300円)ほしい物リストで応援

同じツールの、ほかの解説

解説の一覧を見る

How to Turn Base64 Back into a File

Published: Oct 19, 2026 | Updated: Oct 19, 2026 | About (Japanese)

Key points
  • Choose
  • Paste
  • Save

An API result or an email contains a long string of letters and digits (Base64) that seems to be an image or PDF. "Base64 → file" in Convert Files and Base64 can turn it back into the original file.

Steps

  1. For "Direction", choose "Base64 → file".
  2. Paste the string into "Base64 text".
  3. Enter the "File name to save", with an extension (for example image.png, document.pdf).
  4. Press "Save as file" to save.
  5. Open the saved file and check it.
If "Could not read as Base64. Check the characters." appears, characters are missing or extra ones are mixed in.

Deciding the extension

The Base64 text alone doesn't tell the original file type. Judge from clues like these.

For data URLs

A string with a leading part like "data:image/png;base64," can be pasted as it is. Or paste only the characters after the comma, excluding the leading part.

Checking after saving

Good for

Example

An API response contained a long Base64 string. Pasted it into "Base64 → file", named the file "result.pdf" and saved. It opened as a PDF.

Common stumbling blocks

Frequently asked questions

Can long strings be pasted?

Yes. But very long ones take time.

Summary

Paste and save with a file name that has an extension. Judge the type from the first characters or documentation.

Use "Convert Files and Base64" (free)

Tools that go well with this

If this guide helped, a small tip would mean a lot.

Send a tip (¥300)Send a gift (Amazon wishlist)

More guides for this tool

See all guides