입력

클릭하거나 파일을 드래그 앤 드롭하세요

PDF, 이미지, 오디오, 동영상, 문서 (최대 10MB)

출력

File to Base64 Examples

Upload any file to get its Base64 or Data URI output. Example of a Data URI for a 1×1 PNG:

Sample Data URI output

Data URI format

Upload a file above to generate your own Base64 output.

What Is File to Base64?

File to Base64 converts any binary file into a Base64-encoded ASCII string. Unlike the Image to Base64 tool which is limited to image types, this tool accepts any file type: PDFs, audio files, video clips, Word documents, ZIP archives, fonts, and more. Base64 is defined by RFC 4648 and encodes binary data as printable ASCII text.

The output can be a full Data URI (e.g., data:application/pdf;base64,...) or just the raw Base64 string. Data URIs embed files directly in HTML, CSS, or JSON without needing separate file hosting. Processing runs entirely in your browser—no data is sent to any server. To convert Base64 back to a downloadable file, use Base64 to File.

How to Use This Tool

1

Upload Your File

Click the upload area, drag and drop a file, or use the Upload button. Any file type is accepted up to 10 MB. The left panel shows the file name, size, and detected MIME type.

2

Choose Output Format

Toggle Include data: prefix to switch between a full Data URI (ready for HTML/CSS embedding) and a raw Base64 string (for APIs or storage). The right panel updates immediately.

3

Copy or Download

Click Copy to put the output on your clipboard, or Download to save it as a .txt file. To decode Base64 back to the original file, use Base64 to File.

Data URI vs Raw Base64

A Data URI includes the MIME type and encoding scheme as a prefix:

Data URI format

Use Data URIs when embedding files in HTML, CSS, or JSON (e.g., <img src="data:image/png;base64,..."> or background-image: url(data:image/svg+xml;base64,...)). Use raw Base64 when sending to APIs that specify the MIME type separately, or when storing in a database field. The toggle on this tool lets you switch between both formats instantly.

Frequently Asked Questions

Is my data private?

Yes. Conversion runs entirely in your browser using the FileReader.readAsDataURL() API. No data is sent to any server. You can verify this by checking your browser's Network tab.

What file types are supported?

All file types are supported: images (JPG, PNG, SVG, WebP), documents (PDF, DOCX), audio (MP3, WAV), video (MP4, WebM), fonts (TTF, WOFF), archives (ZIP), and any other binary format. The MIME type is detected automatically from the file.

What is the size limit?

The tool limits uploads to 10 MB. Base64 encoding adds ~33% overhead, so a 10 MB file produces ~13.3 MB of text. Very large files may slow down the browser. For huge files, consider command-line tools like GNU base64.

Can I embed a PDF in HTML?

Yes. Upload your PDF, enable the Data URI toggle, and use the output as: <embed src="data:application/pdf;base64,..." type="application/pdf">. Browser support for embedded PDFs varies. For large PDFs, an external URL is usually better for performance.

How do I convert Base64 back to a file?

Use the Base64 to File tool. Paste your Base64 string, specify the filename and MIME type, and download the reconstructed file.

Related Tools

For the Base64 specification, see RFC 4648. MDN's Data URIs guide covers embedding. FileReader API handles file reading in the browser.

CSS에 이미지를 포함하거나, 아이콘을 Data URI로 번들링하거나, 작은 PDF를 JSON 설정에 넣는 작업 — 개발자들은 생각보다 자주 이 워크플로우를 만납니다. 이 도구는 브라우저에서 직접 모든 파일을 Base64로 변환합니다. 드래그 앤 드롭만 하면 됩니다 — 파일은 절대 컴퓨터를 떠나지 않습니다.

파일을 Base64로 변환하는 방법

1

파일 업로드 또는 드롭

업로드 영역을 클릭하거나 이미지, PDF, 문서, 오디오 등 어떤 파일이든 변환기에 드래그 앤 드롭합니다. 이 도구는 모든 파일 형식과 호환됩니다.

2

Base64 문자열 받기

파일이 즉시 Base64 인코딩된 문자열로 변환됩니다. 완전히 인코딩된 출력이 출력 상자에 나타나 바로 사용할 수 있습니다.

3

인코딩된 문자열 복사

복사 버튼을 클릭하여 Base64 문자열을 가져옵니다. HTML(data URI), CSS, JSON 페이로드 또는 바이너리 데이터를 텍스트로 포함해야 하는 곳에 사용하세요.

출력 예시

예시: 작은 PNG 아이콘을 Base64로 변환

파일:

icon.png (1x1 픽셀 투명 PNG, 68바이트)

Base64 출력 (data URI 형식):

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==

Frequently Asked Questions

어떤 종류의 파일을 Base64로 변환할 수 있나요?

브라우저가 읽을 수 있는 모든 파일 — 이미지, PDF, 오디오, 비디오, 문서 등. 유일한 제한은 10MB입니다.

파일이 서버에 업로드되나요?

아니요. 변환은 FileReader API를 사용하여 브라우저에서 로컬로 수행됩니다.

Base64와 Data URI의 차이점은 무엇인가요?

Base64는 인코딩 자체입니다 (RFC 4648). Data URI는 data:image/png;base64,와 같은 MIME 유형 접두사를 추가합니다.

Base64는 파일 크기를 증가시키나요?

예 — Base64 인코딩은 데이터 크기를 약 33% 증가시킵니다. 따라서 작은 파일에 가장 적합합니다.

Related Tools