Security & Encryption Công cụ đã được cập nhật 1 ngày trước

Data URI / Base64 To Image Converter

Turn a Data URI or raw Base64 string back into a previewable, downloadable image. Choose the MIME type, add an optional file name and check the decoded dimensions.

Decoding is local, but an image from an untrusted source is still untrusted. The current build has a duplicate paste control, so paste directly into the textarea.

Data URI Input Base64 to Image Convert Data Download Image

Sử dụng Data URI / Base64 To Image Converter

Base64 / Data URI → Hình ảnh

Dán một Data URI (data/:image...;base64,...) hoặc mã Base64 thô và xem trước/tải xuống hình ảnh ngay lập tức trên trình duyệt của bạn.
Chỉ chạy ở phía máy khách
Mẹo: Nếu bạn dán mã Base64 thô, hãy chọn loại MIME phù hợp trong danh sách dưới đây (ví dụ: image/png).
Phần mở rộng được tự động xác định dựa trên loại MIME.
Liên kết công cụ
Đã sao chép vào khay nhớ tạm.
Hãy giúp cải thiện công cụ này

Đọc nội dung

Tìm hiểu cách thức hoạt động của công cụ này và khi nào nên sử dụng nó.

Data URI / Base64 to Image

What a Data URI image is

A Data URI packs an image into a text string. It starts with data:, then a media type such as image/png, then a base64 marker and the encoded bytes. Browsers can display that string directly in an image tag, which is why small icons sometimes appear inside HTML or CSS without a separate file. This page goes the other way: it takes a Data URI or a raw Base64 string and turns it back into a preview and a downloadable image.

Raw Base64 versus a full Data URI

A full Data URI contains the media type, so the page can infer the format. A raw Base64 string contains only the payload, so you must choose the correct MIME type yourself. If you choose PNG for JPEG bytes, the preview may fail or the downloaded file may not open in some applications. If you are unsure, inspect the first characters of the decoded data or ask the person who supplied the string for the original media type.

How to convert the string

Paste the Data URI or raw Base64 into the textarea. Choose the matching MIME type from the list: PNG, JPEG, WebP, GIF, SVG, BMP or AVIF. Optionally enter a file name without a path. Press convert. The page decodes the payload, shows an image preview, reports the width and height, regenerates a clean Data URI and estimates the byte size. Use the download button to save the image.

Choosing the right MIME type

The type must match the actual bytes, not the file extension you want. A JPEG normally starts with bytes that identify JFIF or Exif, while a PNG starts with a characteristic signature. SVG is text-based XML, not a bitmap. AVIF support depends on the browser's decoder. If the preview is blank, try the other likely type, but do not keep guessing blindly; a wrong label can produce a file that opens in one program and fails in another.

Preview, dimensions and file name

The preview is rendered by the browser. The width and height come from the decoded image, so they are a useful check that the string contains the image you expected. The optional file name is used for the download; the extension is added from the selected MIME type. Keep the name short and avoid slashes, quotes and control characters. The page does not upload the file, rename it on a server or create a permanent link.

Supported formats and browser limits

The menu covers common web formats, but support is ultimately browser-dependent. PNG, JPEG, GIF and WebP are widely supported. SVG previews as an image and may be restricted by browser security rules. BMP is large but usually readable. AVIF needs a modern browser with an AVIF decoder. There is no explicit size cap, but a very large Base64 string can freeze the tab because the whole value is held in memory. Split or compress huge images before pasting.

Why the preview can fail

A blank preview usually means the Base64 is truncated, contains whitespace or line breaks that were not cleaned, uses an unexpected alphabet, or is labelled with the wrong MIME type. A Data URI copied from a chat app may have lost characters. A string copied from a database may include escaped quotes. If the page reports an image error, re-copy the full value and confirm that it begins with a valid data: prefix or a clean Base64 payload.

The paste button issue

The page has more than one control with the same paste identifier, so the settings-area paste action can do nothing in the current build. Paste directly into the textarea with the keyboard or the browser's context menu. The main convert, clear, copy and download buttons are the reliable path. If a button appears unresponsive, try the keyboard shortcut or paste manually rather than assuming the image is invalid.

Security and privacy

Decoding runs in your browser, so the string is not sent to Newisty. That does not make an unknown image safe. SVG can contain scripts or external references, and a downloaded file can be malicious regardless of its extension. Treat images from untrusted sources with caution, open them in a sandboxed viewer if necessary, and do not run an SVG as a script. Clear the textarea when you are done if the content is sensitive.

When this is useful

It is handy for recovering a small image from an HTML email, a CSS file, a JSON API response or a database dump. It can also help you inspect a Data URI before embedding it in a page. It is not a batch converter, an image editor or a compression tool. If you need to resize, crop or reduce the file size, decode the image first and use an image editor, then re-encode it.

Common problems

If the downloaded file will not open, check the selected MIME type and the first bytes of the payload. If the dimensions are wrong, you may have decoded a different image than you expected. If the textarea rejects a very long string, the browser may be hitting a memory limit. If the file name has no extension, add one manually only after confirming the real format. If the Data URI contains a charset parameter, the decoder may still accept it, but the media type must be correct.

What not to do

Do not paste a production secret or a private photo into a public page without checking how it is handled. Do not trust the MIME type alone as a security check. Do not use this page to edit, resize or compress an image. Do not assume a decoded SVG is harmless. Do not strip characters from a Base64 string to make it fit; a truncated payload will not decode correctly.

Frequently Asked Questions

Câu hỏi thường gặp

Các câu trả lời ngắn gọn cho những thắc mắc mà người dùng thường đặt ra trước khi tin tưởng vào kết quả.

No. Decoding and previewing happen in your browser. The string is not sent to Newisty. The browser still holds the image in memory, and any file you download is stored on your device, so manage sensitive content accordingly.

A Data URI includes a media type and a base64 marker before the payload, while raw Base64 contains only the encoded bytes. With raw Base64 you must select the correct MIME type manually. A full Data URI usually tells the page what type to expect.

The string may be truncated, contain spaces or line breaks, use an unsupported alphabet or be labelled with the wrong MIME type. Re-copy the complete value, remove line breaks, and check the media type. An SVG may also be blocked by browser security rules.

The menu lists PNG, JPEG, WebP, GIF, SVG, BMP and AVIF. Actual support depends on the browser. PNG, JPEG, GIF and WebP are the safest choices. AVIF needs a modern decoder, and SVG previews can be restricted.

Yes. Enter a name without a path, and the page uses it for the download with an extension based on the selected MIME type. Avoid slashes, quotes and control characters. The name does not change the image bytes.

The current build has duplicate paste identifiers, so the settings-area paste control may be inactive. Paste directly into the textarea with Ctrl+V or the context menu. The convert and download controls still work.

Not necessarily. SVG is XML and can contain scripts or external references. Open untrusted SVGs in a sandboxed viewer, do not execute them as scripts, and do not assume that a successful preview proves the file is harmless.

Bình luận (0)

Dành cho các cuộc thảo luận của người dùng, các trường hợp ngoại lệ và các mẹo bổ sung.
Để lại bình luận
Bình luận của bạn sẽ được hiển thị công khai sau khi gửi.
Chưa có bình luận nào. Hãy là người đầu tiên bình luận!
Hãy cho chúng tôi biết!
Báo cáo sự cố liên quan đến công cụ này

Hãy mô tả vấn đề mà bạn gặp phải để chúng tôi có thể tìm hiểu và cải thiện công cụ này.

Điều gì hữu ích nhất
Vui lòng cung cấp thông tin về dữ liệu đầu vào, kết quả mong đợi, kết quả thực tế, trình duyệt/thiết bị và ảnh chụp màn hình (nếu có thể).
Nút chụp màn hình sẽ chụp lại trang web trong trình duyệt và đính kèm hình ảnh được tạo ra vào biểu mẫu này.
Ảnh chụp màn hình toàn trang
Được ghi lại trên trình duyệt của bạn bằng newisty.
Chưa có ảnh chụp màn hình nào được chụp.
Công cụ Báo cáo