JSON ↔ Base64 Converter

    Encode JSON to Base64 or decode Base64 to JSON

    Real-time Conversion

    Encode/decode as you type

    100% Private

    All processing happens in your browser

    No Signup

    Free tool, no registration required

    JSON to Base64: Serializing Structured Data for Transport

    Converting JSON to Base64 encodes a complete JSON object — including all its nested structure, arrays, and values — as a single Base64 string. The process is: serialize the object to a JSON string (JSON.stringify()), then Base64-encode the resulting string. The recipient reverses the process: Base64-decode to get the JSON string, then parse it (JSON.parse()) to recover the original object.

    Why Encode JSON as Base64?

    The main use cases: embedding JSON in contexts that don't allow arbitrary characters. URL query parameters can't contain raw curly braces, quotes, or colons without percent-encoding — Base64 avoids this. JWTs (JSON Web Tokens) encode their header and payload as Base64url (a URL-safe variant of Base64) so they can travel in HTTP headers and URL fragments without escaping. Some messaging systems, HTML attributes, and configuration formats are text-only and can't carry raw JSON without encoding. Base64 turns any JSON object into a safe, portable, single-token string.

    Base64 vs Base64url

    Standard Base64 uses + and / as the 62nd and 63rd characters, and pads with =. These characters are not safe in URLs. Base64url replaces + with - and / with _, and omits padding. JWTs use Base64url. If you're embedding Base64-encoded JSON in a URL or HTTP header, use the Base64url variant to avoid double-encoding issues.

    How to Use This Tool

    Paste your JSON object and click Convert. The tool serializes the JSON with minimal whitespace and encodes it as Base64. The output string can be decoded back to the original JSON at any time. Both standard Base64 and Base64url output are available.

    Frequently Asked Questions