Base64 Encoder / Decoder
Easily convert between text and Base64. UTF-8 encoding is used.
π How to Use
Type or paste text to encode or decode. Supports all UTF-8 characters including Korean, Japanese, and special symbols.
Click πΌ Encode to convert text to Base64, or π½ Decode to convert Base64 back to text.
Click π Copy to save to clipboard, or ποΈ Clear to start over.
About the Base64 Encoder / Decoder
Base64 (defined in RFC 4648) is a binary-to-text encoding that represents arbitrary bytes using only 64 printable ASCII characters: the uppercase letters A–Z, lowercase a–z, digits 0–9, and the symbols + and /, with = used as padding. It exists because many protocols — email, HTTP headers, JSON strings — can only safely carry text, so any binary payload must first be turned into bytes that fall inside the ASCII safe range.
How it works
The encoder treats the input as a stream of bits and reads it in groups of 6. Because three bytes hold 24 bits (3 × 8), they split exactly into four 6-bit indices, and each index selects one character from the 64-symbol Base64 alphabet. Those four characters form one output unit. When the input length is not a multiple of three bytes, the final group is padded: one leftover byte produces two characters plus ==, and two leftover bytes produce three characters plus =. This is why a single = means one byte was left over and == means two. The + and / symbols (and = padding) are not URL-safe, so URL-safe Base64 variants swap them for - and _.
A side effect of carrying 6 bits per character is that the output grows to roughly 133% of the input size (4 characters per 3 bytes), so Base64 is an encoding, not compression — and definitely not encryption. It is fully reversible: anyone with the string can decode it back to the original bytes. Treat it as a transport shape, never as a way to hide a secret.
Common use cases
- Embedding small images or fonts as
data:URIs directly in HTML or CSS - Encoding credentials for HTTP Basic Auth (
user:pass→Authorizationheader) - Carrying the three dot-separated segments of a JWT (
header.payload.signature) - Attaching binary files inside MIME email (
Content-Transfer-Encoding: base64) - Storing binary blobs in JSON or XML, which only accept text
Worked example
Encoding the 5-character string Hello:
Input text: Hello
UTF-8 bytes: 48 65 6C 6C 6F (5 bytes)
Base64: SGVsbG8=
The first three bytes (H, e, l) map to SGVs, the next two (l, o) form an incomplete triple, so they become bG8= with one = pad. Decoding SGVsbG8= reverses every step and returns Hello exactly.
Frequently asked questions
Is Base64 encryption?
No. Base64 is an encoding, not encryption. It is fully reversible and uses a public, well-known alphabet, so anyone can decode it. It only transforms data into a text-safe shape; it provides zero confidentiality and must never be used to protect secrets.
Why does the output get longer than the input?
Every 3 input bytes (24 bits) become 4 Base64 characters, so the encoded text is about 33% larger than the raw bytes. Any leftover bytes at the end are padded with = characters to reach a multiple of 4 characters.
What do the = signs at the end mean?
They are padding. When the input length is not a multiple of 3 bytes, the final 6-bit group is incomplete, so = is appended to make the total character count a multiple of 4. One = means one leftover byte; two = means two leftover bytes.
Does this tool support UTF-8 text like Korean?
Yes. The text is first encoded to UTF-8 bytes, and those bytes are then Base64-encoded. Multibyte characters such as Hangul, emoji, or CJK text are handled correctly, and decoding reverses the process back to the original string.
Is my data sent to a server?
No. Encoding and decoding run entirely in your browser using the native btoa and atob functions. Your input never leaves your device, so it is safe for tokens and sensitive values.
Base64 μΈμ½λ/λμ½λλ?
Base64(RFC 4648μ μ μλ¨)λ μμμ λ°μ΄νΈλ₯Ό 64κ°μ μΆλ ₯ κ°λ₯ν ASCII λ¬Έμλ‘ νννλ λ°μ΄λ리-ν¬-ν
μ€νΈ μΈμ½λ©μ
λλ€. μ¬μ©νλ λ¬Έμλ λλ¬Έμ A–Z, μλ¬Έμ a–z, μ«μ 0–9, κ·Έλ¦¬κ³ κΈ°νΈ +μ /μ΄λ©°, ν¨λ©μλ =λ₯Ό μλλ€. μ΄ μΈμ½λ©μ΄ μ‘΄μ¬νλ μ΄μ λ μ΄λ©μΌ, HTTP ν€λ, JSON λ¬Έμμ΄ κ°μ λ§μ νλ‘ν μ½μ΄ ν
μ€νΈλ§ μμ νκ² μ λ¬ν μ μκΈ° λλ¬Έμ΄λ©°, λ°λΌμ λͺ¨λ λ°μ΄λ리 νμ΄λ‘λλ ASCII μμ λ²μ μμ λ°μ΄νΈλ‘ λ¨Όμ λ³νλμ΄μΌ ν©λλ€.
μλ λ°©μ
μΈμ½λλ μ
λ ₯μ λΉνΈ μ€νΈλ¦ΌμΌλ‘ κ°μ£Όνκ³ 6λΉνΈ λ¨μλ‘ μ½μ΅λλ€. μΈ λ°μ΄νΈλ 24λΉνΈ(3 × 8)λ₯Ό λ΄μΌλ―λ‘ μ νν λ€ κ°μ 6λΉνΈ μΈλ±μ€λ‘ λλλ©°, κ° μΈλ±μ€λ 64κ°μ Base64 μνλ²³μμ λ¬Έμ νλλ₯Ό μ νν©λλ€. μ΄ λ€ λ¬Έμκ° νλμ μΆλ ₯ λ¨μκ° λ©λλ€. μ
λ ₯ κΈΈμ΄κ° 3λ°μ΄νΈμ λ°°μκ° μλλ©΄ λ§μ§λ§ κ·Έλ£Ήμ ν¨λ©λ©λλ€. λ¨μ λ°μ΄νΈκ° νλμ΄λ©΄ λ λ¬Έμμ ==κ°, λ κ°μ΄λ©΄ μΈ λ¬Έμμ =κ° λΆμ΅λλ€. κ·Έλμ = νλλ λ¨μ λ°μ΄νΈκ° νλ, ==λ λ¨μ λ°μ΄νΈκ° λμμ λ»ν©λλ€. +μ / κΈ°νΈ(κ·Έλ¦¬κ³ = ν¨λ©)λ URLμ μμ νμ§ μμμ, URL μμ Base64 λ³νμ μ΄λ₯Ό -μ _λ‘ λ°κΏλλ€.
λ¬ΈμλΉ 6λΉνΈλ₯Ό λ΄λ λΆμ ν¨κ³Όλ‘ μΆλ ₯μ μ λ ₯ ν¬κΈ°μ μ½ 133%(3λ°μ΄νΈλΉ 4λ¬Έμ)λ‘ μ»€μ§λλ€. λ°λΌμ Base64λ μΈμ½λ©μΌ λΏ μμΆμ΄ μλλ©°, λλμ± μνΈνλ μλλλ€. μμ ν κ°μμ μ΄μ΄μ λ¬Έμμ΄μ κ°μ§ λꡬλ μλ λ°μ΄νΈλ‘ λμ½λ©ν μ μμ΅λλ€. μ μ‘ ννλ‘λ§ λ€λ£¨κ³ , λΉλ°μ μ¨κΈ°λ μ©λλ‘λ μ λ μ°μ§ λ§μΈμ.
μμ£Ό μ°λ κ²½μ°
- μμ μ΄λ―Έμ§λ ν°νΈλ₯Ό HTML/CSSμ
data:URIλ‘ μ§μ μλ² λνκΈ° - HTTP Basic Auth μ격μ¦λͺ
μΈμ½λ©(
user:pass→Authorizationν€λ) - JWTμ μ μΌλ‘ ꡬλΆλ μΈ μΈκ·Έλ¨ΌνΈ(
header.payload.signature) μ λ¬νκΈ° - MIME μ΄λ©μΌ μμ λ°μ΄λ리 νμΌ μ²¨λΆ(
Content-Transfer-Encoding: base64) - ν μ€νΈλ§ λ°λ JSONμ΄λ XMLμ λ°μ΄λ리 λΈλ‘ μ μ₯νκΈ°
μ¬μ© μ
5κΈμ λ¬Έμμ΄ Helloλ₯Ό μΈμ½λ©νλ©΄:
Input text: Hello
UTF-8 bytes: 48 65 6C 6C 6F (5 bytes)
Base64: SGVsbG8=
μ²μ μΈ λ°μ΄νΈ(H, e, l)λ SGVsλ‘, λ€μ λ λ°μ΄νΈ(l, o)λ λΆμμ ν μΈ λ¬Άμμ΄ λμ΄ = ν¨λ νλμ ν¨κ» bG8=κ° λ©λλ€. SGVsbG8=λ₯Ό λμ½λ©νλ©΄ λͺ¨λ λ¨κ³κ° μμμΌλ‘ μ§νλμ΄ μ νν Helloκ° λμμ΅λλ€.
μμ£Ό 묻λ μ§λ¬Έ
Base64κ° μνΈνμΈκ°μ?
μλλλ€. Base64λ μΈμ½λ©μ΄μ§ μνΈνκ° μλλλ€. μμ ν κ°μμ μ΄λ©° 곡κ°λ μνλ²³μ μ°λ―λ‘ λꡬλ λμ½λ©ν μ μμ΅λλ€. λ°μ΄ν°λ₯Ό ν μ€νΈ μμ ννλ‘ λ°κΏ λΏ κΈ°λ°μ±μ μ ν μ 곡νμ§ μμΌλ―λ‘ λΉλ°μ 보νΈνλ μ©λλ‘λ μ λ μ°λ©΄ μ λ©λλ€.
μ μΆλ ₯μ΄ μ λ ₯λ³΄λ€ κΈΈμ΄μ§λμ?
μ
λ ₯ 3λ°μ΄νΈ(24λΉνΈ)κ° 4κ°μ Base64 λ¬Έμκ° λλ―λ‘, μΈμ½λ©λ ν
μ€νΈλ μμ λ°μ΄νΈλ³΄λ€ μ½ 33% λ κΉλλ€. λμ λ¨μ λ°μ΄νΈλ μ΄ λ¬Έμ μκ° 4μ λ°°μκ° λλλ‘ = λ¬Έμλ‘ ν¨λ©λ©λλ€.
λμ = κΈ°νΈλ λ¬΄μ¨ λ»μΈκ°μ?
ν¨λ©μ
λλ€. μ
λ ₯ κΈΈμ΄κ° 3λ°μ΄νΈμ λ°°μκ° μλλ©΄ λ§μ§λ§ 6λΉνΈ κ·Έλ£Ήμ΄ λΆμμ ν΄μ Έμ, μ 체 λ¬Έμ μλ₯Ό 4μ λ°°μλ‘ λ§μΆκΈ° μν΄ =λ₯Ό λΆμ
λλ€. = νλλ λ¨μ λ°μ΄νΈκ° νλ, ==λ λ¨μ λ°μ΄νΈκ° λμμ λ»ν©λλ€.
νκ΅μ΄ κ°μ UTF-8 ν μ€νΈλ μ§μλλμ?
λ€. ν μ€νΈλ λ¨Όμ UTF-8 λ°μ΄νΈλ‘ μΈμ½λ©λ λ€ κ·Έ λ°μ΄νΈκ° Base64λ‘ μΈμ½λ©λ©λλ€. νκΈ, μ΄λͺ¨μ§, CJK λ¬Έμ κ°μ λ©ν°λ°μ΄νΈ λ¬Έμλ μ¬λ°λ₯΄κ² μ²λ¦¬λλ©°, λμ½λ©νλ©΄ μλ λ¬Έμμ΄λ‘ λλμκ°λλ€.
λ°μ΄ν°κ° μλ²λ‘ μ μ‘λλμ?
μλλλ€. μΈμ½λ©κ³Ό λμ½λ©μ μ μ μΌλ‘ λΈλΌμ°μ μμμ λ€μ΄ν°λΈ btoa/atob ν¨μλ‘ μ²λ¦¬λ©λλ€. μ
λ ₯μ κΈ°κΈ°λ₯Ό λ λμ§ μμΌλ―λ‘ ν ν°μ΄λ λ―Όκ°ν κ°μλ μμ ν©λλ€.