DevOnlineTools

Base64 Encoder & Decoder

A fast, client-side Base64 encoder and decoder. Convert plain text, JSON, or raw data into RFC 4648 Base64 strings. Supports standard Base64 and URL-safe Base64 variants with UTF-8 character encoding.

devonlinetools://encoding/base64-encoder-decoder
⌘ + EnterRun / Format
Shortcuts Active
Input: 32 B·Output: 44 B·Overhead: +47%

Code Snippets & Examples

Copy-paste ready code implementations for your project:

JavaScript / Browser & Node.js
// Browser
const encoded = btoa('Hello World');
const decoded = atob(encoded);

// Node.js Buffer
const b64 = Buffer.from('Hello World').toString('base64');
const str = Buffer.from(b64, 'base64').toString('utf-8');
Python 3
import base64

# Encode
encoded = base64.b64encode(b'Hello World').decode('utf-8')

# Decode
decoded = base64.b64decode(encoded).decode('utf-8')
Bash CLI
# Encode string
echo -n "Hello World" | base64

# Decode string
echo "SGVsbG8gV29ybGQ=" | base64 --decode

Întrebări Frecvente

What is Base64 encoding?

Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format using 64 printable characters (A-Z, a-z, 0-9, +, /). It is commonly used to embed images in HTML/CSS, transmit data in URLs, and format email attachments.

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

Standard Base64 uses + and / characters and = padding. URL-safe Base64 replaces + with - and / with _ to prevent conflicts in URL parameters and web forms.

Does Base64 encrypt data?

No. Base64 is an encoding, NOT encryption. Anyone can decode a Base64 string back to its original data. Never use Base64 alone to secure sensitive data or passwords.