Base64 Encoder / Decoder

Easily convert between text and Base64. UTF-8 encoding is used.

Result will appear here.

πŸ“– How to Use

1
Enter Text

Type or paste text to encode or decode. Supports all UTF-8 characters including Korean, Japanese, and special symbols.

2
Encode or Decode

Click πŸ”Ό Encode to convert text to Base64, or πŸ”½ Decode to convert Base64 back to text.

3
Use the Result

Click πŸ“‹ Copy to save to clipboard, or πŸ—‘οΈ Clear to start over.

πŸ’‘ Tip: Base64 is commonly used for email attachments, data URIs, and API authentication tokens.

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 AZ, lowercase az, digits 09, 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:passAuthorization header)
  • 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 문자둜 ν‘œν˜„ν•˜λŠ” λ°”μ΄λ„ˆλ¦¬-투-ν…μŠ€νŠΈ μΈμ½”λ”©μž…λ‹ˆλ‹€. μ‚¬μš©ν•˜λŠ” λ¬ΈμžλŠ” λŒ€λ¬Έμž AZ, μ†Œλ¬Έμž az, 숫자 09, 그리고 기호 +와 /이며, νŒ¨λ”©μ—λŠ” =λ₯Ό μ”λ‹ˆλ‹€. 이 인코딩이 μ‘΄μž¬ν•˜λŠ” μ΄μœ λŠ” 이메일, 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:passAuthorization 헀더)
  • 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 ν•¨μˆ˜λ‘œ μ²˜λ¦¬λ©λ‹ˆλ‹€. μž…λ ₯은 κΈ°κΈ°λ₯Ό λ– λ‚˜μ§€ μ•ŠμœΌλ―€λ‘œ ν† ν°μ΄λ‚˜ λ―Όκ°ν•œ 값에도 μ•ˆμ „ν•©λ‹ˆλ‹€.