Кодировщик/декодировщик 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.
Как пользоваться (по шагам)
- 1
Choose encode or decode
Encode turns text or binary into a Base64 string. Decode does the reverse. The tool detects valid Base64 automatically when you paste.
- 2
Paste your input
For files, drop them into the upload zone. For text, type or paste directly. Length isn't an issue for typical web payloads.
- 3
Copy the result
Encoded output is safe to put in URLs, JSON, HTML data attributes. Decoded output is the original bytes — useful for inspecting JWT payloads or embedded credentials.
Как это работает
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.
Частые вопросы
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.
Рекомендуемые инструменты
Подборка полезных утилит
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.
Как пользоваться (по шагам)
- 1
Choose encode or decode
Encode turns text or binary into a Base64 string. Decode does the reverse. The tool detects valid Base64 automatically when you paste.
- 2
Paste your input
For files, drop them into the upload zone. For text, type or paste directly. Length isn't an issue for typical web payloads.
- 3
Copy the result
Encoded output is safe to put in URLs, JSON, HTML data attributes. Decoded output is the original bytes — useful for inspecting JWT payloads or embedded credentials.
Как это работает
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.
Частые вопросы
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.