Online Base64 Encoder and Decoder with Base64url and UTF-8 Text Support

Encode UTF-8 text to Base64, decode Base64 back to readable text, and switch to URL-safe Base64url when values need to travel in query strings, path segments, tokens, logs, or API payloads. Everything runs locally in the browser.

  • All encoding and decoding happens locally in the browser with no server upload
  • Supports both standard Base64 and URL-safe Base64url variants
  • Designed for UTF-8 text, JSON snippets, URL values, auth headers, and debug logs
  • Side-by-side input and output with copy and output-as-input workflow

Base64 Encode & Decode

Encode UTF-8 text, JSON, API parameters, or credentials into Base64, and decode Base64 or Base64url strings back to readable text.

Base64 Encode Decode
0 chars
0 chars
Base64 commands
Conversion mode
General options

What this Base64 tool can do

A focused local workflow for Base64 encoding, Base64 decoding, and Base64url conversion in everyday developer debugging tasks.

  • Encode to Base64

    Convert UTF-8 text, JSON, configuration snippets, and credentials into standard Base64 strings for API debugging, headers, and text transport.

  • Decode from Base64

    Restore Base64 fields from logs, API responses, config files, queues, and cache entries into readable text for inspection.

  • URL-safe variant

    Use the URL-safe Base64url variant that substitutes + and / with - and _ for use in query parameters and path segments.

  • UTF-8 text handling

    Uses browser TextEncoder and TextDecoder APIs, so multilingual text, symbols, and JSON can be encoded safely without the classic btoa Unicode issue.

  • Bidirectional swap

    Send output back to input to verify round trips or continue converting between standard Base64 and Base64url.

  • Instant copy and clear

    Copy the result to your clipboard with one click, or clear both fields to start fresh.

How to use this page

Choose encode or decode, paste text or a Base64 string, and review the result immediately.

  1. 1

    Select Encode or Decode to set the conversion direction.

  2. 2

    Type or paste your input into the text area.

  3. 3

    The result updates in real time in the output area.

  4. 4

    Use Copy to grab the output, or Use output as input to verify the reverse conversion.

  5. 5

    Turn on URL-safe mode when the value belongs in a query string, path segment, or unpadded token.

When to use each mode

The difference between encode and decode matters most when handling data in transit.

  • Use Encode when you need to prepare text for data URLs, email attachments, or storage in systems that expect Base64.
  • Use Decode when you receive a Base64 string and need to inspect, edit, or use the original content.
  • Use URL-safe mode when the encoded value will appear in a URL query parameter or URL path segment.
  • Use the default UTF-8 text flow for multilingual text, JSON, URLs, and most API debugging cases.

Common use cases

Base64 conversion appears frequently in frontend/backend development, API integration, debugging, and configuration workflows.

  • Data URLs in HTML and CSS

    Embed small images, fonts, or icons as Base64 data URLs to reduce HTTP requests in single-file pages and prototypes.

  • API payload encoding

    Encode JSON blocks, configuration text, or serialized strings for text fields in REST, GraphQL, queue messages, and integration payloads.

  • Authentication headers

    Encode credentials or token components for Basic Auth headers, OAuth flows, and signed request formats.

  • Debugging and inspection

    Decode Base64 strings found in API logs, browser developer tools, or configuration files to inspect their original content.

  • JWT and token troubleshooting

    Inspect Base64 segments in authentication tokens to verify expected header and payload structure during auth debugging.

  • Queue and cache payload checks

    Decode Base64 fields stored in message queues, Redis, or database records to validate what was actually persisted.

Practical guidelines

Follow these rules to avoid encoding mismatches and data loss.

If the Base64 result will be embedded in a query string or callback URL, use URL Encode & Decode next for percent-encoding. When debugging login state, Bearer tokens, or three-part tokens, open JWT Inspector to inspect header and payload data. For embedding image files in HTML, CSS, or JSON, use Image to Base64 ; when you already have an image Base64 string and need to preview or restore it, use Base64 to Image .

  • Confirm the original payload is actually text. Images, archives, and audio may decode into non-printable bytes rather than readable content.
  • Use URL-safe mode when the Base64 string will appear in URLs; standard Base64 can break certain URL parsers.
  • Base64 adds roughly 33% overhead compared to the original binary size. For large payloads, consider compression or streaming.
  • Do not use Base64 for encryption. Base64 is an encoding format, not a security mechanism.
  • When decoding, remove any leading or trailing whitespace to avoid padding-related failures.
  • For cross-language services, standardize on UTF-8 and document that encoding in your API contract.
  • Treat Base64 as a transport format; keep original structured data and metadata where long-term traceability matters.

Limitations and important notes

Knowing the boundaries helps avoid surprises during conversion.

  • Base64 is approximately 33% larger than the original binary data, which can affect storage and transfer costs for large payloads.
  • This page encodes and decodes UTF-8 text. It does not provide ISO-8859-1, Windows-1252, GBK, or other character set switching.
  • Very large files (hundreds of megabytes) may cause memory pressure in the browser. This page is designed for strings, configuration blocks, and moderate payloads.
  • This page does not support direct file upload for Base64 conversion. If you need to encode a file, use a dedicated file-to-Base64 page.
  • Base64 encoding does not provide data integrity guarantees like checksums or hashes.
  • Auto-detection of URL-safe Base64 is pattern-based; for edge cases, manually confirm the intended variant.
  • Decoded output readability depends on whether the source was text; binary payloads may decode to non-printable characters.

Frequently asked questions

Answers to common questions about usage, data handling, result checks, and practical limits.

01

Is Base64 encryption?

No. Base64 is an encoding scheme, not encryption. Anyone can decode a Base64 string using standard tools. Do not use Base64 to protect sensitive data.

02

What is the difference between standard Base64 and URL-safe Base64?

Standard Base64 uses +, /, and = characters. URL-safe Base64 replaces + with -, / with _, and removes trailing = padding so the string is safe in URLs.

03

Why does the decoded output sometimes show garbled text?

Garbled output usually means the original payload was not UTF-8 text, or that it was binary content such as an image or compressed file. This page is intended for text Base64, not general binary inspection.

04

Can I encode binary files with this tool?

This page is designed for text input. For encoding binary files, use the dedicated Image to Base64 tool or a file upload utility.

05

Does this page send my data to a server?

No. All encoding and decoding is performed locally in your browser. No data is transmitted to any server.

06

What is Base64 used for in practice?

Common uses include data URLs in HTML, email attachments (MIME), API text payloads, authentication headers, and passing encoded content through text-based formats such as JSON.

07

Why do some Base64 strings not end with "="?

That is common in URL-safe Base64 or systems that omit padding. The decoder can often restore missing padding before decoding.

08

Why is decoded output garbled or blank?

The original content may not be UTF-8 text, or it may be binary content such as an image or archive. Those cases need a file-aware or hex inspection tool.

More encoding, decoding, and scannable code tools

DevKitLab provides online tools for Base64 encoding and decoding, URL encoding and decoding, QR code generation and parsing, barcode generation and parsing, and other tasks involving links, text, image encoding, and scannable codes.