Base64 Converter
Encode text, JSON, XML, YAML, TSV, and CSV to Base64 or decode Base64 back to its original format. Supports UTF-8 encoding, URL-safe output, MIME line breaks, and binary file handling through the browser with no server round-trip.
This tool sends nothing over the network. Everything you enter is processed on your device and never reaches our servers.
Documentation
Base64 conversion turns text and binary data into a string of printable characters, and back again. This converter handles UTF-8 text, binary files, and structured formats including JSON, XML, YAML, TSV, and CSV, encoding and decoding entirely in the browser without sending data to a server.
- Conversion runs in either direction: a text or binary input becomes a Base64 string, or a Base64 string reconstructs the original content. Structured formats such as JSON objects, XML documents, YAML configuration blocks, TSV spreadsheet data, and CSV records encode and decode without modification, since Base64 treats input as a byte stream regardless of its internal structure.
- Binary files (images, PDFs, archives) encode straight from their own bytes rather than through a text field, since binary content cannot be represented faithfully as typed text.
- The underlying formula: each byte of the input is mapped to a 6-bit index in the Base64 alphabet (A-Z, a-z, 0-9, +, /), producing four output characters for every three input bytes. Decoding reverses this mapping. UTF-8 text is converted to a byte sequence with the TextEncoder API before the Base64 mapping applies, which is why the same character can encode differently under a different character set.
- URL-safe Base64 replaces the
+and/characters with-and_and strips trailing=padding, producing output that survives inclusion in a URL or filename unmodified. - MIME-formatted output (RFC 2045) inserts a line break every 76 characters, a requirement of some email systems and legacy software that Base64 without line breaks does not satisfy.
- Character encoding governs how text becomes bytes before the Base64 mapping runs. UTF-8, the default, preserves multi-byte characters such as accented letters, CJK ideographs, and emoji. ASCII and ISO-8859-1 exist for legacy compatibility when the source data is restricted to a single-byte character set.
- Reversing the mode and moving the output back into the input is a direct way to round-trip test a conversion and confirm nothing was lost.
Base64 encoding appears across web development, data interchange, email systems, and security workflows wherever binary or structured data must travel through text-only channels.
- API Development: Encode JSON request bodies or authentication tokens to Base64 for inclusion in HTTP headers. Decode Base64-encoded API responses to inspect the original JSON, XML, or YAML payload without switching to a separate tool.
- Email and MIME Attachments: Encode binary attachments (images, PDFs, zip archives) to Base64 with MIME line breaks for embedding in multipart email messages. Decode Base64 blocks extracted from raw email source to recover the original file content.
- Data URIs and Inline Assets: Encode small images, SVG icons, or font files to Base64 for embedding directly in HTML or CSS using data URIs, eliminating extra HTTP requests on page load.
- Configuration Files: Encode YAML or JSON configuration blocks to Base64 for storage in environment variables or secret management systems such as Kubernetes Secrets, which require Base64-encoded values.
- Spreadsheet and Tabular Data: Encode TSV or CSV exports to Base64 for safe transport through systems that might corrupt delimiters, line endings, or special characters. Decode received Base64 strings back to the original tabular format for import into spreadsheet applications.
- Security and Forensics: Decode suspicious Base64 strings found in logs, scripts, or network captures to reveal obfuscated commands or payloads. Encode test payloads to Base64 for controlled injection during penetration testing or input validation audits.
- Database Storage: Encode binary blobs or structured XML documents to Base64 for storage in text-only database columns. Decode stored values back to their original format for inspection or migration between systems.
- URL-Safe Tokens: Encode session identifiers, JWT segments, or signed parameters using the URL-safe variant to produce strings that pass through URLs and file paths without percent-encoding conflicts.
Inputs, outputs, and what the Base64 Converter computes
What the Base64 Converter asks for and what it returns, as a plain list. Defaults, units, and ranges are the ones the form loads with.
Inputs
- Mode · default: Encode to Base64
- Input
- URL-safe Base64 (replace + / with - _ and remove padding) · default: off
- Add line breaks every 76 characters (MIME format) · default: off
- Character Encoding · default: UTF-8
- Output
Controls
Convert · Reset · Copy