Base64 인코더/디코더
텍스트와 이미지를 Base64 형식으로 인코딩/디코딩합니다.
Base64 Encoding: When and Why
소개
Base64 is a binary-to-text encoding that represents any data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It exists because many systems — email, JSON, URLs, XML — were designed to handle text only, but we often need to transport binary data through them. Encoding adds about 33% overhead (3 bytes of input → 4 bytes of output) in exchange for compatibility. Despite being from 1987, Base64 remains essential for embedding images in CSS/HTML (data URLs), MIME email attachments, JWT tokens, and many web APIs.
작동 원리
The encoder takes 3 bytes (24 bits) at a time and splits them into 4 groups of 6 bits each, then maps each 6-bit value (0-63) to one of the 64 characters. If the input length isn't divisible by 3, '=' padding is added. Decoding reverses the process. URL-safe Base64 substitutes '-' for '+' and '_' for '/' so the encoded output can be used in URLs without further encoding. This tool runs entirely in your browser — no data ever transmits to a server.
언제 유용한가
Encode small images as data URLs to embed directly in HTML or CSS (avoids extra HTTP requests for icons). Decode JWT tokens to inspect their payload (the header and payload are Base64URL-encoded JSON). Convert between binary and text formats when working with APIs that accept only text. Quickly inspect 'mailto:?body=...' or other URLs containing encoded data.
자주 묻는 질문
Is Base64 encryption?
No — it's encoding, not encryption. Anyone can decode it. Use Base64 only for transport, never for hiding data. If confidentiality matters, encrypt first, then Base64 the ciphertext if needed for text transport.
Why does my encoded string end with '='?
Padding. Base64 outputs in blocks of 4 characters representing 3 input bytes. If input bytes don't divide evenly by 3, '=' fills the last block. One missing byte = '==', two missing = '='.
What's Base64URL?
A variant safe for URLs and filenames — replaces '+' with '-' and '/' with '_', and omits padding '='. Used by JWT tokens and many web APIs. Some tools convert between regular and URL-safe automatically.
추천 도구
유용할 수 있는 엄선된 도구