Guide
Base64 for developers: text, JSON, URLs, and what it is not
Learn when to Base64-encode text or JSON, how that differs from URL percent-encoding, and why Base64 is not encryption.
Published 2026-07-23
Base64 turns bytes into ASCII so data can travel through JSON, email, and other text-only channels. On this site, encoding and decoding run in your browser.
Text and JSON payloads
Use Base64 Encode / Decode for general UTF-8 strings. When the input is a JSON document destined for an opaque API field, start from Base64 Encode JSON, then validate the decoded text with JSON tools if needed.
URLs: percent-encoding vs Base64
- URL Encode / Decode — escape query or form components (encodeURIComponent-style)
- Base64 Encode URL — Base64 the entire URL string for state bags or redirects
- Raw Base64 in a query string may still need percent-encoding because of + / =
Not encryption
Base64 is reversible by design. Pair it with TLS and proper auth — never rely on encoding alone to hide secrets.
const bytes = new TextEncoder().encode(text);
const b64 = btoa(String.fromCharCode(...bytes));Try these tools
Base64 Encode / Decode
Encode UTF-8 text to Base64 or decode Base64 back to text — instantly in your browser.
URL Encode / Decode
Percent-encode text for URLs or decode encoded query strings — private and instant.
Base64 Encode JSON
Encode JSON payloads to Base64 for APIs, JWTs, and transport — decode back to UTF-8 JSON in your browser.
Base64 Encode URL
Encode URLs and query strings to Base64 for opaque links and redirects — distinct from percent-encoding.
Frequently asked questions
Is Base64 encryption?
No. Anyone can decode Base64. Use it for transport and embedding, not secrecy.
URL Encode or Base64 Encode URL?
Percent-encode individual query values with URL Encode. Use Base64 Encode URL when the entire link must become an opaque Base64 blob.
More long-form writing may also appear on blog.rsroshi.dev.