Introduction

The Base64 Encoder and Decoder converts text, files, URL-safe strings, and Data URLs directly in your browser. It is built for developers who need to inspect API payloads, encode configuration values, decode tokens or samples, embed small assets, or quickly check whether a Base64 string is valid.

How to Use

Choose Auto, Encode, or Decode mode, then paste text or Base64 data into the input area. You can also select a local file to convert it to Base64 or a Data URL. Adjust options such as URL-safe output, padding, line wrapping, and per-line processing, then copy or download the result.

Features

  • Encode and decode Unicode text correctly
  • Auto mode for detecting likely Base64 input
  • URL-safe Base64 with optional padding
  • Line wrapping at common 64 or 76 character lengths
  • Data URL detection and generation for small assets
  • Local file-to-Base64 conversion with image preview
  • Decode Base64 and download the resulting file
  • Validation notices, byte counts, and output ratio

What Base64 Is Used For

Base64 represents binary data using plain text characters. That makes it useful when data must travel through systems that expect text, such as JSON, XML, environment variables, email bodies, data URLs, and some API fields. It is not a compression format and it is not encryption.

Base64 Is Not Security

A common mistake is treating Base64 as a way to hide secrets. Anyone can decode Base64. If you are handling passwords, private keys, tokens, or personal data, use proper encryption, hashing, access control, and secret storage instead of relying on encoding.

When to Use URL-Safe Base64

Standard Base64 may contain +, /, and =. These characters can be awkward inside URLs or filenames. URL-safe Base64 replaces + with - and / with _, and sometimes removes padding. This variant is common in JWTs, URL parameters, and web-safe identifiers.

Data URLs and File Conversion

A Data URL combines a media type and Base64 data into a single string, such as an inline image. Data URLs are convenient for small assets, previews, and quick prototypes, but large Data URLs can make HTML or CSS heavy and harder to cache.

Base64 Variant Guide

Choose the format that matches where the encoded value will be used.

VariantCharactersCommon Use
Standard Base64A-Z, a-z, 0-9, +, /, =General encoding, email, JSON fields
URL-safe Base64A-Z, a-z, 0-9, -, _, optional =JWTs, URL parameters, filenames
Base64 with line wrapStandard Base64 split into linesMIME email and legacy systems
Data URLdata:type;base64,...Inline images or small embedded assets

Base64 Size Expectations

Base64 usually increases data size because binary data is represented as text.

Original DataExpected Base64 SizeNote
3 bytes4 charactersBase64 encodes data in 3-byte groups
1 KB fileAbout 1.33 KB textRoughly 33% larger before metadata
Data URLBase64 plus prefixAdds media type and encoding label
Compressed fileStill larger after Base64Encoding is separate from compression

Frequently Asked Questions

Is Base64 encryption?

No. Base64 is encoding, not encryption. Anyone with the encoded string can decode it back to the original data.

What is URL-safe Base64?

URL-safe Base64 replaces plus and slash with hyphen and underscore so the value is easier to use in URLs, JWTs, and filenames.

Should Base64 padding be kept?

Standard Base64 uses padding with equals signs. Some URL-safe systems omit padding, but the expected format depends on the system you are working with.

Are files uploaded to a server?

No. File encoding and decoding happen locally in your browser.

Why is my Base64 output longer than the original?

Base64 turns binary data into text, which usually increases size by about one third, plus any Data URL prefix or line breaks.