🔄 JSON ⇄ Base64
Encode JSON to Base64 and decode Base64 back to pretty JSON.
Conversion
Sponsored
How it works
How it works
- Uses
btoa/atobto Base64‑encode/decode, wrapped with URI encoding tricks to handle UTF‑8 safely in browsers. - “JSON → Base64” encodes the raw JSON string; “Base64 → JSON” decodes and pretty‑prints with 2‑space indentation.
- Note:
btoa/atoboperate on Latin‑1; the wrapper avoids mojibake for non‑ASCII text. For binary data, preferUint8Arrayand a dedicated Base64 routine. - Base64URL uses
-/_instead of+//and strips=padding (not used here).
Privacy & Security
No network traffic.
Sponsored
Accuracy, Limits & Tips
Large objects may be slow; no streaming.
Examples
{"foo":123}→eyJmb28iOjEyM30=
Related tools
- 📋 JSON Formatter & ValidatorFormat/minify and validate JSON.
- 📊 CSV → JSONConvert simple CSV to JSON.
- 🔀 YAML ⇄ JSONConvert between YAML (subset) & JSON.
- 🔣 Base64 Encode / DecodeConvert text to/from Base64.
- 🔢 Base ConverterConvert numbers between bases.
- 🏛️ Roman NumeralsConvert to/from Roman numerals.
Sponsored
You may also like
Looking for broader guides and best practices? Visit the ToolsAreUs Blog for indexes (like the full tool list) and articles (e.g. secure password generation).