Base64 Encoder & Decoder
Encode or decode UTF-8 text as standard or URL-safe Base64. Useful for API payloads, Basic Auth debugging, and data snippets.
This conversion runs only in your browser — nothing is uploaded.
URL-safe uses - and _ instead of + and /, and omits = padding.
- Input0
- Output0
- OptionsStandard
Input
Output
For image files, use Image to Base64 — Data URI Encoder
What is this tool?
This Base64 encoder and decoder converts between UTF-8 text and Base64. Choose Standard (+/ with = padding) or URL-safe (-_ without padding) depending on where the value will be used.
Base64 is encoding, not encryption: there is no secret key, and anyone can reverse the string. Output is about one-third larger than the input because every three bytes become four ASCII characters.
Use it for text payloads, Basic Auth debugging, and short data snippets. It is not a file encoder—use Image to Base64 for binary images and data URIs.
Common use cases
- Prepare or inspect Base64 fields in API JSON bodies and headers
- Build or decode the credential part of an HTTP
Authorization: Basic …header - Encode short text for data-URI style snippets (text only; images belong on Image to Base64)
How to use
- Choose Encode or Decode. Conversion updates live as you type.
- Toggle URL-safe when the value must use
-_and omit=padding. - Paste UTF-8 text (encode) or a Base64 string (decode). Whitespace in Base64 input is ignored.
- Copy the output. If decode fails, match Standard vs URL-safe and check padding or truncation.
Examples
| Input / setting | Output | Notes |
|---|---|---|
Hello → Standard encode | SGVsbG8= | Classic UTF-8 sample with padding. |
SGVsbG8= → Decode | Hello | Round-trip of the sample above. |
user:pass → Standard encode | dXNlcjpwYXNz | Credential blob before a Basic Auth header. |
subjects?_d → URL-safe encode | c3ViamVjdHM_X2Q | Uses _ instead of / and omits = (edge vs standard). |
Practical pitfalls
- Base64 is not encryption or access control—treat encoded secrets as still exposed.
- Mixing alphabets breaks consumers: a JWT-style URL-safe string will fail many “standard only” decoders if you leave
-_or strip padding incorrectly. - This page encodes text, not arbitrary files; large binaries belong in Image to Base64 or offline tooling.
References
이 도구는 무엇인가요?
UTF-8 텍스트와 Base64를 서로 변환합니다. 표준(+/, = 패딩)과 URL-safe(-_, 패딩 생략)를 선택할 수 있습니다.
Base64는 암호화가 아닙니다. 비밀 키 없이 되돌릴 수 있고, 3바이트가 4문자가 되어 대략 33% 커집니다.
API 페이로드, Basic Auth 디버깅, 짧은 텍스트 조각에 맞습니다. 이미지·바이너리 파일은 이미지 → Base64 도구를 쓰세요.
자주 쓰는 경우
- API JSON·헤더의 Base64 필드를 만들거나 확인
Authorization: Basic …에 넣을사용자:비밀번호인코딩- data URI 형태의 짧은 텍스트 조각 준비(이미지는 별도 도구)
사용 방법
- Encode 또는 Decode를 선택합니다. 입력하면 결과가 바로 갱신됩니다.
- 쿼리·경로에 넣을 값이면 URL-safe를 켭니다.
- 텍스트 또는 Base64를 붙여넣습니다. Base64의 공백은 무시됩니다.
- 결과를 복사합니다. 디코딩 오류 시 표준/URL-safe와 패딩을 맞춥니다.
예시
| 입력 / 설정 | 출력 | 메모 |
|---|---|---|
Hello → 표준 인코딩 | SGVsbG8= | 패딩이 있는 기본 샘플 |
SGVsbG8= → 디코딩 | Hello | 위 샘플의 왕복 |
user:pass → 표준 인코딩 | dXNlcjpwYXNz | Basic Auth용 자격 증명 덩어리 |
subjects?_d → URL-safe | c3ViamVjdHM_X2Q | / 대신 _, = 생략 |
실무에서 흔한 실수
- Base64로 감싼 비밀도 그대로 노출된 것으로 취급하세요.
- 표준과 URL-safe 알파벳을 섞으면 서버·라이브러리 디코더가 실패하기 쉽습니다.
- 이 페이지는 텍스트 전용입니다. 큰 바이너리·이미지는 이미지 → Base64를 사용하세요.
참고자료
このツールについて
UTF-8 テキストと Base64 を相互変換します。標準(+/ と = パディング)と URL-safe(-_、パディング省略)を選べます。
Base64 は暗号化ではありません。秘密鍵なしで元に戻せ、出力は入力より約 33% 大きくなります。
API ペイロード、Basic Auth の確認、短いテキスト断片向けです。画像ファイルは「画像→Base64」を使ってください。
よくある用途
- API の JSON やヘッダー内 Base64 値の作成・確認
Authorization: Basic …用のuser:pass形式のエンコード- 短いテキストの data URI 風スニペット準備(画像は別ツール)
使い方
- Encode / Decode を選びます。入力すると結果がライブ更新されます。
- クエリやパス向けなら URL-safe をオンにします。
- テキストまたは Base64 を貼り付けます。Base64 内の空白は無視されます。
- 出力をコピーします。失敗時は標準/URL-safe とパディングを確認します。
例
| 入力 / 設定 | 出力 | メモ |
|---|---|---|
Hello → 標準エンコード | SGVsbG8= | パディング付きの基本例 |
SGVsbG8= → デコード | Hello | 上記の往復 |
user:pass → 標準エンコード | dXNlcjpwYXNz | Basic Auth 用クレデンシャル |
subjects?_d → URL-safe | c3ViamVjdHM_X2Q | / の代わりに _、= なし |
実務での落とし穴
- Base64 化した秘密も平文同様に扱ってください。
- 標準と URL-safe を混在させるとデコードが失敗しやすくなります。
- このページはテキスト専用です。画像は画像→Base64 を使います。
参考資料
¿Qué es esta herramienta?
Convierte texto UTF-8 ↔ Base64. Elige Estándar (+/ con relleno =) o URL-safe (-_ sin relleno) según el destino del valor.
Base64 no es cifrado: no hay clave y cualquiera puede revertirlo. La salida crece ~33% porque cada 3 bytes pasan a 4 caracteres ASCII.
Sirve para payloads de API, depurar Basic Auth y fragmentos de texto. Para imágenes usa Imagen a Base64.
Casos de uso comunes
- Preparar o revisar campos Base64 en JSON y cabeceras de API
- Codificar
usuario:contraseñaparaAuthorization: Basic … - Fragmentos de texto estilo data URI (las imágenes van a otra herramienta)
Cómo usar
- Elige Encode o Decode; la conversión se actualiza al escribir.
- Activa URL-safe si el valor irá en consulta o ruta.
- Pega texto o Base64; los espacios en Base64 se ignoran.
- Copia el resultado. Si falla el decode, alinea el modo y el relleno.
Ejemplos
| Entrada / opción | Salida | Notas |
|---|---|---|
Hello → Estándar | SGVsbG8= | Muestra clásica con padding |
SGVsbG8= → Decode | Hello | Ida y vuelta |
user:pass → Estándar | dXNlcjpwYXNz | Credencial Basic Auth |
subjects?_d → URL-safe | c3ViamVjdHM_X2Q | _ en lugar de /, sin = |
Errores prácticos
- Un secreto en Base64 sigue expuesto.
- Mezclar alfabetos estándar y URL-safe rompe muchos decodificadores.
- Esta página es solo texto; archivos de imagen → Imagen a Base64.
Referencias
Qu'est-ce que cet outil ?
Convertit du texte UTF-8 ↔ Base64. Choisissez Standard (+/ avec padding =) ou URL-safe (-_ sans padding) selon l’usage.
Base64 n’est pas du chiffrement : pas de clé, réversible par tous. La sortie grossit d’environ 33 % (3 octets → 4 caractères).
Utile pour les payloads API, le débogage Basic Auth et les courts extraits. Pour les images, utilisez Image vers Base64.
Cas d'usage courants
- Préparer ou inspecter des champs Base64 dans JSON et en-têtes d’API
- Encoder
utilisateur:motdepassepourAuthorization: Basic … - Petits extraits texte style data URI (les images ont un autre outil)
Comment utiliser
- Choisissez Encode ou Decode ; la conversion suit la saisie.
- Activez URL-safe pour les requêtes ou chemins.
- Collez le texte ou le Base64 ; les espaces du Base64 sont ignorés.
- Copiez le résultat. En cas d’échec, alignez le mode et le padding.
Exemples
| Entrée / réglage | Sortie | Notes |
|---|---|---|
Hello → Standard | SGVsbG8= | Exemple classique avec padding |
SGVsbG8= → Decode | Hello | Aller-retour |
user:pass → Standard | dXNlcjpwYXNz | Identifiants Basic Auth |
subjects?_d → URL-safe | c3ViamVjdHM_X2Q | _ à la place de /, sans = |
Pièges courants
- Un secret encodé en Base64 reste exposé.
- Mélanger alphabets standard et URL-safe fait échouer beaucoup de décodeurs.
- Cette page est réservée au texte ; images → Image vers Base64.
Références
这个工具是什么?
在 UTF-8 文本与 Base64 之间转换。可按用途选择标准(+/ 与 = 填充)或 URL-safe(-_、通常无填充)。
Base64 不是加密:无密钥,任何人都能还原。输出大约比输入大约 33%(每 3 字节变为 4 个 ASCII 字符)。
适合 API 载荷、Basic Auth 调试和短文本片段。图片文件请用「图片转 Base64」。
常见用途
- 准备或检查 API JSON/请求头中的 Base64 字段
- 将
user:pass编码进Authorization: Basic … - 准备短文本 data URI 风格片段(图片用另一工具)
如何使用
- 选择 Encode 或 Decode;输入时结果实时更新。
- 需要放进查询或路径时打开 URL-safe。
- 粘贴文本或 Base64;Base64 中的空白会被忽略。
- 复制结果。解码失败时对齐标准/URL-safe 与填充。
示例
| 输入 / 设置 | 输出 | 说明 |
|---|---|---|
Hello → 标准编码 | SGVsbG8= | 带填充的经典示例 |
SGVsbG8= → 解码 | Hello | 往返验证 |
user:pass → 标准编码 | dXNlcjpwYXNz | Basic Auth 凭据块 |
subjects?_d → URL-safe | c3ViamVjdHM_X2Q | 用 _ 代替 /,无 = |
实践中的常见误区
- Base64 编码的密钥仍应视为已暴露。
- 混用标准与 URL-safe 字母表会导致许多解码器失败。
- 本页仅处理文本;图片请用「图片转 Base64」。
参考资料
這個工具是什麼?
在 UTF-8 文字與 Base64 之間轉換。可依用途選擇標準(+/ 與 = 填充)或 URL-safe(-_、通常無填充)。
Base64 不是加密:無密鑰,任何人都能還原。輸出約比輸入大約 33%(每 3 位元組變為 4 個 ASCII 字元)。
適合 API 酬載、Basic Auth 除錯與短文字片段。圖片檔請用「圖片轉 Base64」。
常見用途
- 準備或檢查 API JSON/標頭中的 Base64 欄位
- 將
user:pass編碼進Authorization: Basic … - 準備短文字 data URI 風格片段(圖片用另一工具)
如何使用
- 選擇 Encode 或 Decode;輸入時結果即時更新。
- 需要放進查詢或路徑時開啟 URL-safe。
- 貼上文字或 Base64;Base64 中的空白會被忽略。
- 複製結果。解碼失敗時對齊標準/URL-safe 與填充。
範例
| 輸入 / 設定 | 輸出 | 說明 |
|---|---|---|
Hello → 標準編碼 | SGVsbG8= | 帶填充的經典範例 |
SGVsbG8= → 解碼 | Hello | 往返驗證 |
user:pass → 標準編碼 | dXNlcjpwYXNz | Basic Auth 憑證區塊 |
subjects?_d → URL-safe | c3ViamVjdHM_X2Q | 用 _ 代替 /,無 = |
實務上常見陷阱
- Base64 編碼的密鑰仍應視為已暴露。
- 混用標準與 URL-safe 字母表會讓許多解碼器失敗。
- 本頁僅處理文字;圖片請用「圖片轉 Base64」。
參考資料
Last reviewed: 2026-07-26
Frequently asked questions
- Is Base64 encryption?
- No. Base64 is reversible encoding with no secret key. Anyone with the string can decode it.
- What is the difference between standard and URL-safe Base64?
- Standard Base64 uses + and / and often ends with = padding. URL-safe Base64 (RFC 4648 §5) uses - and _ instead and usually omits padding so the value can sit in query strings or path segments.
- Why does decoding fail with a padding or alphabet error?
- Strict decoders expect a matching alphabet and valid length. Missing = padding, mixed +/ with -_, or truncated strings are common causes. Try the matching Standard or URL-safe mode, or add padding until the length is a multiple of four.
- Can I encode an image file here?
- This tool is for UTF-8 text. For image files and data URIs, use the Image to Base64 tool instead.