Base64 Encode & Decode

Base64 Encode & Decode is a free, instant online tool for converting text and binary data to and from Base64 format. Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters, making it safe to transmit over text-based protocols like email (MIME), JSON, XML, and URLs. This tool handles both encoding (converting your data to Base64) and decoding (converting Base64 back to original text or binary). It supports UTF-8 text, handles large inputs efficiently, and works entirely in your browser with no data sent to any server. Perfect for developers working with API authentication headers, data URIs, JWT tokens, or any scenario requiring Base64 conversion.

What Is

Base64 is an encoding scheme that converts binary data into a text string using a set of 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). The equals sign (=) is used as padding at the end to ensure the output length is a multiple of 4. Why Base64 exists: Many systems and protocols were designed to handle only text data. When you need to send binary data (images, files, encrypted content) through these text-only channels, Base64 provides a safe representation that won't be corrupted by character encoding issues, special characters, or transport mechanisms. Common use cases: - Email attachments (MIME): Binary files are Base64-encoded for email transmission - Data URIs: Embed images directly in HTML/CSS using data:image/png;base64,... - HTTP Basic Authentication: Credentials are encoded as Base64 in the Authorization header - JSON Web Tokens (JWT): The header and payload sections are Base64-encoded - API payloads: Binary data in JSON APIs is often Base64-encoded - URL parameters: Binary data can be safely passed in URLs using Base64URL variant - Certificate encoding: PEM files use Base64 to encode X.509 certificates How Base64 works: 1. Input data is split into groups of 3 bytes (24 bits) 2. Each 24-bit group is divided into four 6-bit segments 3. Each 6-bit value maps to a character in the Base64 alphabet 4. If input isn't divisible by 3, padding characters (=) are added The encoded output is approximately 33% larger than the original binary data. For text input, the size increase depends on the character encoding used.

How to Use

  1. Choose your operation mode: select 'Encode' to convert text or binary data to Base64, or 'Decode' to convert a Base64 string back to its original form. The tool automatically detects the mode based on your input in many cases.
  2. For encoding: paste or type your text into the input area. This can be plain text, JSON, HTML, or any string content. For binary data, use the file upload button to select a file from your device — the tool will read and encode it automatically.
  3. For decoding: paste a Base64-encoded string into the input area. The tool handles standard Base64 (with + and /) as well as Base64URL (with - and _) variants. It also handles strings with or without padding characters (=).
  4. Select your encoding options. For text encoding, choose the character encoding of your input (UTF-8 is default and recommended). For decoding, choose whether to output as text (UTF-8) or as a downloadable binary file.
  5. Click the 'Encode' or 'Decode' button to perform the conversion. The result appears instantly in the output area. For large files, a progress indicator shows the encoding/decoding status.
  6. Copy the result to your clipboard with the 'Copy' button, or download it as a file. For decoded binary data, the download button saves the original file with its correct MIME type and extension.

Examples

Input: Encode: Hello World

Process: ASCII → Binary → 6-bit groups → Base64 alphabet

Result: SGVsbG8gV29ybGQ=

Input: Decode: SGVsbG8gV29ybGQ=

Process: Base64 alphabet → 6-bit groups → Binary → ASCII

Result: Hello World

Input: Encode: user:pass (Basic Auth)

Process: UTF-8 bytes → Base64

Result: dXNlcjpwYXNz

Related Searches

People also search for: base64 encode, base64 decode, base64 converter, base64 online.

base64 encodebase64 decodebase64 converterbase64 online

Frequently Asked Questions

What is the difference between Base64 and Base64URL?

Base64URL is a variant of Base64 designed for use in URLs and filenames. It replaces the '+' character with '-' and '/' with '_', and typically omits the padding '=' characters. This makes the output safe to include in URL parameters without additional percent-encoding. The tool supports both standard Base64 and Base64URL formats for both encoding and decoding.

Can I encode files and images with this tool?

Yes. Use the file upload button to select any file from your device — images, PDFs, documents, or any binary file. The tool reads the file using the FileReader API and encodes it to Base64. The resulting Base64 string can be used in data URIs, embedded in JSON payloads, or stored in databases. For large files (over 10MB), encoding may take a few seconds depending on your device's performance.

Is Base64 encoding the same as encryption?

No, absolutely not. Base64 is an encoding scheme, not encryption. Anyone can decode Base64 data back to its original form — there is no secret key or password involved. Base64 should never be used to protect sensitive data. If you need to encrypt data, use proper encryption algorithms like AES-256. Base64 is only useful for safely representing binary data in text formats, not for security.

Why does my Base64 string end with one or two equals signs?

The equals signs (=) are padding characters. Base64 encodes data in groups of 3 bytes, producing 4 output characters. If the input length isn't a multiple of 3, padding is added to make the output length a multiple of 4. One remaining byte produces 2 characters + 2 padding signs (==), two remaining bytes produce 3 characters + 1 padding sign (=). The padding is required for correct decoding by most implementations.

How do I handle Base64 in different programming languages?

Most languages have built-in Base64 support. In JavaScript: btoa() for encoding, atob() for decoding (for binary data, use FileReader or Buffer). In Python: base64.b64encode() and base64.b64decode(). In Java: java.util.Base64.getEncoder() and getDecoder(). In C#: Convert.ToBase64String() and Convert.FromBase64String(). In PHP: base64_encode() and base64_decode(). All these handle the standard Base64 alphabet with padding.

Related Tools

UUID Generator

Generate universally unique identifiers (UUIDs) instantly with our free online UUID Generator. Whether you are a software developer creating database keys, a system administrator managing distributed systems, a QA engineer generating test data, or a data engineer partitioning datasets, this tool provides RFC 4122-compliant UUIDs in multiple versions. Generate version 1 (time-based), version 4 (random), version 5 (namespace-based), and other UUID variants with a single click. Set the number of UUIDs to generate, choose uppercase or lowercase output, and optionally include or exclude hyphens. Copy individual UUIDs or download the entire list. Perfect for database seeding, distributed system identifiers, session tokens, request tracking, and any scenario requiring guaranteed-unique identifiers without a central coordination authority.

JWT Decoder

Decode and inspect JSON Web Tokens instantly with our free online JWT decoder. Paste any JWT to see its header, payload, and signature components decoded and displayed in readable format. Whether you are debugging authentication flows, verifying token claims, examining third-party tokens, understanding JWT structure, or troubleshooting authorization issues, this tool provides complete transparency into token contents with support for HS256, RS256, ES256, and other common signing algorithms. All decoding happens in your browser for security.

Password Strength Checker

Worried your password might be too weak to protect your accounts? Our Password Strength Checker gives you an instant, accurate assessment of any password's real-world security. It evaluates multiple critical factors — length, character diversity, common patterns, dictionary words, and keyboard sequences — to produce a comprehensive strength score. You also get an estimated crack time that shows exactly how long it would take an attacker to break your password using modern hardware. The entire analysis runs locally in your browser, so your password never touches a server. Whether you are creating a new password, auditing existing ones, or setting organizational security policies, this tool provides clear, actionable feedback to help you make smarter security decisions.

JSON Formatter

Format, beautify, and validate JSON data instantly with our free online tool. Paste raw JSON to get a properly indented, syntax-highlighted, and human-readable version with comprehensive error detection and reporting. Whether you are debugging API responses, cleaning up configuration files, analyzing log data, preparing JSON for documentation, or learning JSON structure, this formatter provides instant results with customizable indentation levels. The built-in validator catches syntax errors with precise line and column indicators for fast troubleshooting.

URL Encode Decode

Encode and decode URLs instantly with our free online URL Encode/Decode tool. Whether you are a web developer handling query parameters, an API engineer working with HTTP requests, a data analyst processing web logs, or anyone who needs to safely transmit special characters in URLs, this tool provides instant, accurate conversion in both directions. URL encoding converts special characters into a format that can be safely transmitted over the internet, while URL decoding reverses this process to recover the original text. Simply paste your URL or string and get the encoded or decoded result in real-time. The tool handles Unicode characters, spaces, symbols, and all special characters defined in RFC 3986. Input your data and click the corresponding button to transform it instantly.

Hash Generator

Generate cryptographic hashes instantly with our free online Hash Generator. Compute MD5, SHA-1, SHA-256, SHA-384, SHA-512, and other hash values from text or file input. This essential tool for developers, security professionals, and data integrity verification supports multiple hash algorithms with instant results. Use it to verify file integrity, generate checksums, hash passwords for testing, create unique identifiers, or learn about cryptographic hashing. The tool processes everything locally in your browser — your sensitive data never leaves your device, ensuring complete security and privacy for confidential inputs.

JSON to CSV Converter

Convert JSON data to CSV format instantly with our free online transformer. Upload or paste JSON arrays and get properly formatted CSV output with automatic header detection, customizable delimiters, and nested object flattening. Whether you are exporting API data for spreadsheet analysis, migrating JSON databases to tabular formats, preparing data for Excel or Google Sheets import, generating reports from structured data, or integrating JSON feeds with legacy systems, this converter handles complex structures including nested objects, arrays of objects, mixed data types, and large datasets with configurable options for optimal output.

QR Code Generator

Need a professional QR code for your website, business card, event, product packaging, or marketing campaign? Our free QR Code Generator creates high-quality, scannable QR codes in seconds — no sign-up, no limits, no watermarks. Simply enter your URL, text, contact information, Wi-Fi credentials, or any other data type, and get an instantly scannable QR code that works with every modern smartphone and QR scanner app. Customize colors to match your brand, choose between PNG and SVG output formats, and download your QR code immediately. Whether you are a small business owner sharing contact details, a marketer linking to a landing page, an event organizer distributing tickets, or a restaurant displaying a digital menu, this tool makes QR code creation effortless and accessible to everyone.

HTML Entity Encoder/Decoder

Encode any text into HTML entities for safe web display with our free online HTML Entity Encoder. Convert special characters and symbols into their HTML entity equivalents to prevent rendering issues and security vulnerabilities. This focused tool handles all reserved HTML characters, Unicode symbols, emoji, and multilingual text encoding. Use it to sanitize user input before displaying in web pages, encode code snippets for safe preview, prepare multilingual content for HTML embedding, or ensure cross-browser compatibility for special characters. The encoder supports named entities, numeric decimal, and hexadecimal output formats.

User Agent Generator

Generate realistic User-Agent strings for any browser, device, or operating system with our free online User-Agent Generator. Whether you are a web developer testing responsive layouts, a QA engineer simulating different client environments, a data scientist preparing web scraping configurations, or a security professional analyzing request headers, this tool provides instant access to thousands of real-world User-Agent strings. Select from popular browsers (Chrome, Firefox, Safari, Edge), operating systems (Windows, macOS, Linux, Android, iOS), and device types (desktop, mobile, tablet). Copy individual strings or export lists for automated testing. Customize by browser version, OS version, and device type to match your exact testing requirements.

Regex Tester

Test and debug your regular expressions in real-time with our free online Regex Tester. Whether you are a developer writing pattern-matching code, a data analyst extracting information from text, or a system administrator configuring log filters, this tool provides instant feedback on your regex patterns. Simply enter your regular expression, provide a test string, and immediately see all matches highlighted with detailed group captures. The tool supports all standard regex features including character classes, quantifiers, anchors, lookaheads, backreferences, and flags. Get helpful error messages when your pattern has syntax errors, and use the built-in regex reference guide for quick syntax lookups. No more guessing whether your pattern works — see results instantly and iterate until your regex is perfect.

JSON Validator

Validate JSON data for syntax errors instantly with our free online validator and linter. Paste any JSON string to get immediate feedback on whether it is valid, with precise error location reporting including line numbers, column positions, and exact character offsets. Whether you are verifying configuration files, debugging API request/response payloads, checking data exports, validating user-submitted JSON, or enforcing JSON format compliance in CI/CD pipelines, this tool provides comprehensive validation following the RFC 8259 JSON specification with helpful error messages and quick-fix suggestions.

Popular Tools

EMI Calculator

Planning to take a home loan, car loan, or personal loan and wondering what your monthly payment will look like? Our...

BMI Calculator

Ever stepped on a scale and wondered what that number actually means for your health? Our BMI calculator takes the gu...

Body Fat Percentage Calculator

Have you ever felt like the scale does not tell the whole story? You can weigh the same as someone else but look comp...

CAGR Calculator

When you invest in stocks, mutual funds, or any market-linked asset, one number tells you the real story of how your...

Unit Converter

From cooking to construction, from science to shopping, unit conversion is one of those things you need all the time...

Age Calculator

Figuring out someone's exact age isn't as simple as subtracting birth year from current year. Leap years, different m...

JSON Formatter

Format, beautify, and validate JSON data instantly with our free online tool. Paste raw JSON to get a properly indent...

QR Code Generator

Need a professional QR code for your website, business card, event, product packaging, or marketing campaign? Our fre...

Salary Calculator (Gross to Net)

Understanding your true take-home pay is essential for budgeting, planning, and making smart career decisions, yet mo...

Tip Calculator

Dining out, getting a haircut, taking a taxi, or receiving any kind of personal service often comes with the question...

Word Counter

Need an accurate word count for your essay, article, or document? This word counter gives you instant, precise counts...

Color Code Converter

Color Code Converter is a free online tool that instantly converts color values between different formats used in web...