Base64 Encoder & Decoder
Encode plain text to Base64 or decode Base64 strings to UTF-8 text with URL-safe encoding and automatic JSON formatting.
Batch workspace
Format multiple files locally in one run.
How to use the Base64 Encode & Decode
Paste code or file
Paste your raw TEXT text or upload directly.
Configure options
Choose indentation, dialect, or formatting preferences.
Format & export
Click format, then copy, download, or inspect in tree view.
What is a Base64 Encode & Decode?
Encode plain text to Base64 or decode Base64 strings to UTF-8 text with URL-safe encoding and automatic JSON formatting. This tool re-indents and organizes code according to standard style conventions while checking for syntax validity. Everything executes 100% inside your browser, guaranteeing zero latency and complete privacy for API keys, user tokens, and confidential database schemas.
Base64 shows up in JWTs, data URLs, and protocol buffers. Encode and decode locally with UTF-8-safe handling so secrets never cross the network.
Common errors and fixes
Invalid Base64 character
Remove whitespace or URL-encoding artifacts, or switch to URL-safe mode if your alphabet uses - and _.
Incorrect padding
Base64 length should be a multiple of 4. Add = padding or enable automatic padding repair if available.
Decoded text is garbled
The payload may be binary. Try viewing as a data URL via the Base64 Image converter.
URI malformed
When decoding to UTF-8 text, ensure the bytes form valid Unicode.
Options Explained
| Option | Description |
|---|---|
| Action | Select whether to decode an existing Base64 payload or encode plain text into Base64 format. |
| URL-safe format (- and _) | Replaces standard + and / characters with URL-safe - and _ characters without padding. |
| Auto-format decoded JSON | If the decoded result is valid JSON, it will be automatically formatted and beautified. |
Frequently Asked Questions
Does this Base64 tool support UTF-8 and Unicode characters (e.g. emojis)?
Yes. All strings are converted using standard UTF-8 binary buffers, correctly handling international characters and emojis.
What is URL-safe Base64?
URL-safe Base64 replaces the standard '+' and '/' characters with '-' and '_' to prevent URL query string collision.
Is my Base64 data uploaded to any server?
No. All encoding and decoding happen 100% locally inside your browser memory.
Can this tool format decoded JSON payloads?
Yes. If the decoded payload is valid JSON and 'Auto-format decoded JSON' is checked, it will be beautified automatically.
How do I encode a string to Base64?
Switch the Action option to 'Encode (Text → Base64)' and paste your plain text into the input pane.